navigationview

listPreferredItemHeightSmall is not working on api 16

偶尔善良 提交于 2019-12-06 09:53:45
I am using the code below and it's working fine on api 23 but not on another device on api 16(Jelly Bean) . Style: <style name="NavigationViewStyle"> <item name="android:textSize">20sp</item> <!-- menu item text size--> <item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height--> </style> And then, apply this style to NavigationView using app:theme <android.support.design.widget.NavigationView ... ... app:theme="@style/NavigationViewStyle" ... ... </android.support.design.widget.NavigationView> You should use "android:listPreferredItemHeightSmall" without "android"

Android NavigationView : not show full item and not truncate

[亡魂溺海] 提交于 2019-12-06 08:06:58
问题 Problem : NavigationView not show full text of menu item, also not truncate text . This item I see correctly - two words " Small title ": <item android:id="@+id/example1" android:icon="@drawable/filter_2" android:title="Small title" android:checked="false" app:actionLayout="@layout/menu_counter" /> /> And with next item - I see only first two words " Small title " without any truncate of next word " andveryverylongword ": <item android:id="@+id/example2" android:icon="@drawable/filter_2"

how to change menu item gravity to right in NavigationView

梦想与她 提交于 2019-12-06 02:39:52
I need to put a menu item icon at right of text (by default it's on the left side) so how to change menu item gravity to right in NavigationView ? because we can not custom NavigationView Items,I think it's impossible. can any one help me. my menu xml file is: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:id="@+id/menu_group_2"> <item android:id="@+id/menu_settings" android:title="Settings" /> <item android:id="@+id/menu_about" android:title="About" /> </group> </menu> and my navigationview in layout is <android.support.design.widget.NavigationView android:id

uwp NavigationView control Titlebar

為{幸葍}努か 提交于 2019-12-04 20:20:20
I have a problem with the NavigationView Control and the titlebar. I have tried to extend the view into the titlebar to play with the acrylic effects of the standard NavigationView. But then I´ve noticed that the back and menu buttons are underneath the titlebar, so you´re not able to click them properly. In the attached image, you can see that everything under the red line is clickable but when you go over it, you are targeting the titlebar. Is there anything I can do to fix this behavior? I don't know which version OS you are working on, I didn't see this problem in recent Windows insider OS

Sharing NavigationView with all the Activities?

蓝咒 提交于 2019-12-04 19:34:46
问题 How do we share Drawer with all the activities? In the lister: onNavigationItemSelected of setNavigationItemSelectedListener we can get the id and navigate to it. What I am looking for is something like this: private void initDrawerLayout() { drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); NavigationView navView = (NavigationView) findViewById(R.id.navigation_view); navView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override

Android NavigationView : not show full item and not truncate

对着背影说爱祢 提交于 2019-12-04 11:38:30
Problem : NavigationView not show full text of menu item, also not truncate text . This item I see correctly - two words " Small title ": <item android:id="@+id/example1" android:icon="@drawable/filter_2" android:title="Small title" android:checked="false" app:actionLayout="@layout/menu_counter" /> /> And with next item - I see only first two words " Small title " without any truncate of next word " andveryverylongword ": <item android:id="@+id/example2" android:icon="@drawable/filter_2" android:title="Small title andveryverylongword" android:checked="false" app:actionLayout="@layout/menu

Open second drawerlayout as a sub drawerlayout over the first

▼魔方 西西 提交于 2019-12-04 05:55:06
Android Studio 2.1.3 I have this design I am trying to follow. On the first drawerlayout I have a setttings options. When the user clicks, it will open a second drawerlayout like this below. The user can get back to the first by clicking on the arrow Main Menu . Is this possible? Many thanks for any suggestions It's unclear how exactly you wish to implement your drawer UI, so the following solution is rather generic, in that it should work with NavigationView s, RecyclerView s, or pretty much whatever type of View s you'd like. This solution uses a custom ViewSwitcher subclass that acts as a

NavigationView how to handle dynamic header content

跟風遠走 提交于 2019-12-04 03:25:51
I have a pretty standard NavigationView. When i use a static layout in the header like below it works perfect. <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_height="match_parent" android:layout_width="wrap_content" android:layout_gravity="start" android:fitsSystemWindows="true" app:headerLayout="@layout/nav_header" app:menu="@menu/drawer_view"/> But i want to have a dynamic header so thah i can change it when user logged in etc... So i tried to use a fragment instead of nav_header.xml <android.support.design.widget.NavigationView android:id="@+id/nav

Cannot resolve symbol 'NavigationView'

五迷三道 提交于 2019-12-04 02:12:21
I made a NavigationView inside a DrawerLayout in an XML file - but when I try to initialize it in Java I get this error. // DrawerLayout initialises fine DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.nav_drawer); // Cannot resolve symbol 'NavigationView' NavigationView navView = (NavigationView) findViewById(R.id.navigation_view); I tried adding the import line import android.support.design.widget.NavigationView but this is also giving me errors. Any ideas? Haven't been able to find a solution online. Edit: After adding dependency given in Tanis' answer, I get these errors Error

Horiziontal recyclerview on DrawerLayout

余生长醉 提交于 2019-12-03 16:31:00
This is my NavigationView 's layout <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:headerLayout="@layout/header" app:menu="@menu/meny" /> headerLayout has a horizontal RecyclerView which has some items that user can scroll on it. My problem is whenever I want to scroll in RecyclerView , drawerLayout is going to close . Is there any way to support horizontal RecyclerView on Drawerlayout ? You should disable intercepting touch event on DrawerLayout when user is