Android - 如何实现始终部分可见的 NavigationDrawer? [英] Android - How to implement a NavigationDrawer that is partially visible at all times?

查看:25
本文介绍了Android - 如何实现始终部分可见的 NavigationDrawer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的 Android 项目中有一个 NavigationDrawer,它始终部分显示 ListView,并且这些项目也是可点击的,但是当用户拖动抽屉时,会出现完整的 ListView.

I would like to have a NavigationDrawer in my Android project that shows the ListView partially at all times, and the items are also clickable, but when the user drags the drawer full ListView appears.

下图是我想要实现的目标:

Below image is what I'm trying to achieve:

第一个是普通视图",您可以在其中看到小图标.第二个是当用户滑动导航抽屉以使其打开时.第三个是当用户返回正常视图时,点击 A 和 C,图标会改变颜色.

First one is the "Normal view" where you can see the small icons. Second one is when the user slides the navigation drawer so that it opens. Third one is when back in the normal view the user clicks A and C, so that the icons change their colour.

有没有关于如何做到这一点的建议?

Any recommendations how to do this?

感谢回答:)

推荐答案

我遇到了这个开源库,https://github.com/StevenRudenko/ActionsContentView.我没有亲自使用过它,所以不能说它适合您在右侧有一个抽屉的确切用例,但它确实在左侧有一个抽屉.即便如此,您也可以从那里开始,并且应该能够在此基础上进行构建以适合您的用例.

I came across this open source library, https://github.com/StevenRudenko/ActionsContentView. I haven't personally used it so can't say it will fit in your exact use case of having a drawer at right but it does has the drawer on the left. Even then you could start from there and should be able to build upon it to fit your use case.

这篇关于Android - 如何实现始终部分可见的 NavigationDrawer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆