简体   繁体   English

Android:如何使用自定义布局创建导航抽屉

[英]Android: How to create a navigation drawer with custom layout

I'm trying to create a navigation drawer like this: 我正在尝试创建一个像这样的导航抽屉:

facebook side chat Facebook边聊天

inside the navigation drawer,I need a login page instead of a list,like this: 在导航抽屉中,我需要一个登录页面而不是列表,像这样:

side login page 侧面登录页面

I didn't find any helpful libraries for doing this (SlidingMenu was the library nearest to the solution) and I found just side menu with a list of elements. 我没有找到任何有用的库来做到这一点(SlidingMenu是离解决方案最近的库),而我发现只是带有元素列表的侧面菜单。 Could you please suggest me a solution/library to use? 您能否建议我使用一个解决方案/库? Thank you very much. 非常感谢你。

You can implement by overriding drawer slide listener. 您可以通过覆盖抽屉幻灯片侦听器来实现。 Here it is well explained https://stackoverflow.com/a/33588398/4804264 在这里很好地解释了https://stackoverflow.com/a/33588398/4804264

You can write a custom Viewgroup to control the View(your side menu). 您可以编写一个自定义的Viewgroup来控制View(您的侧面菜单)。 And using the ValueAnimator, you can slide the menu from the side. 使用ValueAnimator,您可以从侧面滑动菜单。

Custom components 定制组件

Custom 自订

Property Animation 物业动画

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM