问题标签 [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 - 打开导航视图后如何启用工具栏控件?
嗨,我是 android studio 的新手,我正在使用支持库设计 22.2.1 的 NavigationView,我记得在我们使用 android studio 拥有的导航抽屉活动模板之前。
使用最后一个方法(模板),我们可以使用工具栏上的按钮:
“ http://i.stack.imgur.com/hmMfr.png ”
但是使用新方法 ww 不能:
“ http://i.stack.imgur.com/uIhwp.png ”
此外,我将向工具栏添加一些按钮,并在工具栏下方添加第二个导航视图(右)。
我不知道是否有任何方法可以帮助我做到这一点。
我的 activity_main.xml 中的代码是:
它位于带有 android:fitsSystemWindows (true) 的 android.support.v4.widget.DrawerLayout 中。
我的 onCreate 主要活动是:
super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
我会感谢你的帮助!此致。
android - NavigationView 中的活动或片段?
我有一个 NavigationView 用作滑入式菜单。每个菜单项本身就是一个用例,因此我倾向于使用包含不同片段的活动。
但是几乎每个示例都NavigationView/NavigationDrawer
使用片段,所以我不知道在这里使用什么。
我认为应该将不同的用例“封装”在自己的活动中,因此我不太明白为什么要Navigation[View/Drawer]
使用片段。这引出了我的问题:对于Navigation[View/Drawer]
包含完全独立的用例 - 我应该链接到活动还是片段?
android - 如何以编程方式打开(显示在屏幕中)NavigationView
如何以编程方式打开(显示在屏幕中)NavigationView?我找不到任何有用的功能。
我有这个 xml 文件:
android - DrawerLayout 上的水平回收视图
这是我NavigationView
的布局
headerLayout
有一个水平的RecyclerView
,其中有一些用户可以在其上滚动的项目。
我的问题是每当我想滚动时RecyclerView
,drawerLayout 就会关闭。
有什么方法可以支持水平RecyclerView
的Drawerlayout
吗?
android - NavigationView -> headerLayout -> ImageButton -> onclick results in IllegalStateException in ContextThemeWrapper
In the headerLayout
of a NavigationView
(on the left side of a DrawerLayout
app) I have an ImageButton
, which should represent ability to add a social network account:
Here is the activity_main.xml with the NavigationView
:
And here the header_left.xml with the ImageButton
:
In the MainActivity.java I have defined the click handler method:
Unfortunately, the app crashes on the ImageButton
click with:
Why does it happen and how to work around the problem please? (Besides adding onClickListener
in MainActivity.java).
I have another ImageButton
in the Toolbar
of the same app - and its onclick handler is called in MainActivity.java just fine.
java - 膨胀类 NavigationView 时出错
运行我的应用程序时出现此错误。有任何想法吗 ?我正在使用 Android Studio 和 SDK 22。
这是它所指的xml:
Headerview.xml :Headerview.xml :Headerview.xml :Headerview.xml :Headerview.xml :Headerview.xml :
这是 XML FOR 菜单/抽屉。xml文件
android - 如何在 NavigationView 中添加 Listview?
我的 android 应用程序中有一个导航抽屉。我可以使用导航视图在导航抽屉中显示菜单,但我想在抽屉中显示列表视图或回收器视图。我需要这样,因为每个用户的抽屉菜单都不一样。用户选择他们想阅读的报纸。例如:
用户 A 的列表视图将是这样的:华盛顿邮报、纽约时报、卫报、独立。
用户 B 的列表视图:每日邮报、华盛顿邮报、金融时报。
如何在导航视图上添加列表视图?
活动主.xml:
menu_drawer.xml :
custom_row.xml :