问题标签 [navigationview]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 如何为设计支持库的 NavigationView 设置样式?
所以我使用的是Android Design Support Library提供的 NavigationView
我似乎无法找到有关如何设置样式的示例。
到目前为止,我有:
设置标题的样式很容易,因为它在自己的 xml 布局下,但正文是菜单资源文件而不是布局。
app:itemTextColor
更改文本颜色app:itemIconTint
更改图标颜色app:itemBackground
更改项目背景颜色
那么如何设置
- 所选项目背景
- 所选项目文本颜色
- 所选项目图标色调
android - 如何更改 NavigationView 中菜单项的图标方向?
嗨,我正在使用 android NavigationView。我想将图标方向更改为 RTL 而不是 LTR,如下所示:
我怎样才能做到这一点?
android - NavigationView 缓慢打开/跳帧(Android 设计库)
我正在使用由Android Design Library提供的 NavigationView 。在向其中添加了一些性能很差的项目后,我发现。在第一次启动时,第一次打开需要一秒钟左右。这是用户界面的屏幕截图。
我将尝试发布一些相关的代码。
抽屉 XML
主要法案
最后,这是我在 Choreographer 的日志中看到的错误,我希望这只是库中的一个错误,但我想知道是否有人遇到过这个问题并且可能有解决方法。
完整源代码可在此处获得:https ://github.com/caman9119/The_Jones_Theory
android - 无法更改 NavigationView 中子项的图标
我正在尝试在NavigationView
没有子项(所有顶级菜单项),我可以使用以下代码愉快地更改图标:
菜单.xml:
如你看到的:
但是,一旦我像这样更改我的 XML:
我发现图标不再更改(即使仍在调用侦听器中的代码)。谁能告诉我为什么这些项目没有更新?
我想知道是否invalidateMenuOptions()
可以在 NavigationView 上调用或者notifyDataSetChanged()
可以在支持数据上调用功能?
android - How to inflate android NavigationView with another menu dynamically during onClick?
Hi I have a NavigationView and there is an imageview in the headerview of that NavigationView. When I click on the imageview , NavigationView should inflate another menu resource file and replace current menu like in PlayStore app.
I've tried this:
But when I click on the button, nothing happens! (Log Onclick is showing in the logcat) How can I do this?
android - app:itemBackground 属性不能按预期工作
我正在尝试为 创建一个自定义选择器NavigationView
,但它没有效果。这是我的代码:
选择器是state_list_drawer_background.xml
,这是代码:
我只能看到透明选择器,而不是自定义选择器。然后,我发现了此处NavigationView
记录的限制:
NavigationView 的 itemBackground 属性无法正确处理项目的选中状态:不知何故,要么所有项目都突出显示,要么都不突出。这使得该属性对于大多数应用程序基本上无法使用。
但是,一些开发人员能够设置自定义选择器,例如黑暗主题上的tTorrent应用程序。我想知道他们怎么能做到!
谁能帮我解决这个问题?
提前致谢。
android - Android - 导航视图项目菜单背景颜色
我尝试更改我的项目导航视图菜单的颜色:
样式.xml
激活的背景.xml
抽屉.xml:
背景颜色不改变..我做错了什么?
android - 选择 NavigationView 菜单项时过滤 RecyclerView 卡片
我有一个设计支持 NavigationView 实现的活动。抽屉有 3 个菜单项:主页、按 X 排序、按 Y 排序。我的活动显示了一个 RecyclerView,其中的卡片显示来自列表的数据。该列表包含具有字符串标记(“X”或“Y”)的对象。I need to sort the RecyclerView by this tag when respective menu item is selected.
我的活动活动:
当我从 Home 片段调用 setFilter 方法时,我得到一个 NPE。
主页片段:
我在filteredObjects.clear() 的setFilter() 方法中得到一个NPE,如果我删除它,我会在for 循环中得到NPE。
日志猫:
编辑:activity_main.xml
android - 有什么方法可以控制 NavigationView 标头中的视图吗?
正如标题所说,我想知道是否有任何方法可以控制NavigationView
标题内的视图?(添加或删除标题除外。)
例如:在标题中,我有一个用户头像。默认情况下,它显示一个客人图像,但用户登录后,将显示真实的头像。
如何实现?