问题
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.
回答1:
Update:
After being ask to do so by a moderator, I'm flagging this and another similar question (as duplicates).
Those questions:
How to implement navigation drawer with fragments master detail
https://stackoverflow.com/questions/25403377/combine-navigation-drawer-and-master-detail-layout
Original Answer:
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/
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!
来源:https://stackoverflow.com/questions/20290973/navigation-drawer-and-master-detail-flow