导航抽屉和主/从流抽屉

2023-09-13 02:09:42 作者:趁现在还在

我尝试用两款Android模板(抽屉式导航+主/详细信息流)。我怎样才能在一个应用程序使用此两个模板?我将感谢任何例子。

I try use two android templates (Navigation Drawer + Master/Details Flow). How can I use this two templates in one app? I will be grateful for any example.

推荐答案

更新:

被要求由版主,我该标记,另一个类似的问题(一式两份),这样做之后。

After being ask to do so by a moderator, I'm flagging this and another similar question (as duplicates).

这些问题: How实现导航抽屉片段掌握细节 combine抽屉式导航栏和主从布局

Those questions: How to implement navigation drawer with fragments master detail combine navigation drawer and master detail layout

原来的答案:

面对同样的问题,我发现它的教程的实际上的使用的两种设计思路在一起:

Faced with the same problem, I found a tutorial on it that actually used the two design ideas together:

http://blog.evizija.si/android-layout/

我只是以他们为榜样,并得到了我的UI根据需要在5分钟的工作。这其实非常简单。你让MasterActivity看起来有点更像产生ItemListActivity(即实施TaskListFragment.Callbacks,复制在onItemSelected方法,和的onCreate的卡盘),你就大功告成了!

I just followed their example and got my UI working as desired in about 5 minutes. It's actually incredibly simple. You make MasterActivity look a bit more like the generated ItemListActivity (ie. implement TaskListFragment.Callbacks, copy over the onItemSelected method, and a chuck of onCreate) and you're done!

我希望这有助于解决您的问题!快乐编码!

I hope this helps solve your problem! Happy coding!

 
精彩推荐
图片推荐