Difference between SlidingPaneLayout and NavigationDrawer

时间秒杀一切 提交于 2020-01-13 10:33:51

问题


I really don't know what is the difference between these two approaches of creating navigation menu. So I read that both can be used as a container for two fragments (main fragment, detail fragment). So can you help me to understand which approach is better and why? I can't find out relevant information.

thank you.


回答1:


The session was "Android Design for UI Developers" by Roman Nurik and Nick Butcher: https://developers.google.com/events/io/sessions/326204977

Pretty much what CommonsWare said, essentially, Navigation Drawer is for chrome and top level navigation, so it overlays app content. SlidingPaneLayout is for content navigation, thus it doesn't overlay content.

EDIT: The video is still available here - https://www.youtube.com/watch?v=Jl3-lzlzOJI




回答2:


So can you help me to understand which approach is better and why? I can't find out relevant information.

This was covered in a Google I|O 2013 presentation, though I forget which one.

SlidingPaneLayout is for content, such as the master-detail pattern. You might use it in place of two layouts for master-detail structures for smaller and larger screens.

DrawerLayout is for navigation. You might use it in place of the dashboard pattern, or using action bar items for navigation, if you have a fair bit of navigation in your app.



来源:https://stackoverflow.com/questions/16801611/difference-between-slidingpanelayout-and-navigationdrawer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!