navigationview

Changing navigationView header text color

人盡茶涼 提交于 2019-11-30 15:57:09
How do you change the header text colors in navigation Drawer. I am using the latest support design library. Image is attached below. Assuming you created it with a separate header xml file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="178dp" android:background="@drawable/background_poly" android:orientation="vertical" android:weightSum="1"> <LinearLayout android:layout_width="match_parent" android:layout_height="56dp" android:orientation="vertical" android:layout

Changing the item text size in navigation view

只谈情不闲聊 提交于 2019-11-30 15:35:54
问题 I am creating a navigation drawer in android and I have added the items in menu_main.xml but I am not able to change the size of the menu items. Below is the code menu_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/motel" android:title="Motel"> </item> <item android:id="@+id/packages" android:title="Packages"> </item> </group> </menu> 回答1: Create a style and apply it to NavigationView using app

Changing the item text size in navigation view

有些话、适合烂在心里 提交于 2019-11-30 14:59:44
I am creating a navigation drawer in android and I have added the items in menu_main.xml but I am not able to change the size of the menu items. Below is the code menu_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/motel" android:title="Motel"> </item> <item android:id="@+id/packages" android:title="Packages"> </item> </group> </menu> Create a style and apply it to NavigationView using app:theme <style name="NavigationViewStyle"> <item name="android:textSize">20sp</item> <!-- menu item text size-->

How to change the size of menu item icon in NavigationView?

允我心安 提交于 2019-11-30 11:45:24
问题 I have the following menu item: <item android:id="@+id/lock" android:checkable="true" android:title="@string/lock" > <menu > <item android:id="@+id/block_mess" android:checked="true" android:icon="@drawable/chantinnhan" android:title="@string/block_mess_string" /> <item android:id="@+id/block_call" android:checked="false" android:icon="@drawable/chancuocgoi" android:title="@string/block_call_string" /> <item android:id="@+id/lock_app" android:checked="false" android:icon="@drawable

How to inflate android NavigationView with another menu dynamically during onClick?

狂风中的少年 提交于 2019-11-30 09:21:30
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: imgIndic.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.e("Onclick","Arrow click"); navigationView.inflateMenu(R.menu.second_menu); } }); But when I click on the button, nothing happens! (Log Onclick is showing in the logcat) How can I do this? try the following code imgIndic.setOnClickListener(new

How to get dividers in NavigationView menu without titles?

柔情痞子 提交于 2019-11-30 05:37:24
I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all the examples I've seen, I see how this can be done by putting another <menu> within an <item> , but the <item> requires to have the android:title attribute, so the best I can do is make the title blank, which leaves an empty space before the settings and help & feedback. <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android

Android NavigationView displays under NavigationBar, and cannot be clicked

女生的网名这么多〃 提交于 2019-11-29 11:20:50
As you can see, the background of NavigationView has been set android:clipToPadding='false' , and it can be seen under transparent NavigationBar . But the NavigationView(NavigationDrawer) cannot fully scroll up to above the NavigationBar , how to solve this? I want the list items scroll to the top of NavigationBar , which means the last Send is not under but above NavigationBar . layout/activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

How to uncheck checked items in Navigation View?

帅比萌擦擦* 提交于 2019-11-29 10:42:20
问题 I know it's possible to highlight a navigation view item by calling setCheckedItem() or return true value in onNavigationItemSelected to display the item as the selected item, but How can I uncheck the checked items of a navigation view? 回答1: This will uncheck the items: int size = mNavigationView.getMenu().size(); for (int i = 0; i < size; i++) { mNavigationView.getMenu().getItem(i).setCheckable(false); } 回答2: I saw @arsent solution and gave it a try, and it will indeed do what you want,

Custom back button for NavigationView's navigation bar in SwiftUI

孤人 提交于 2019-11-29 07:49:14
问题 I want to add a custom navigation button that will look somewhat like this: Now, I've written a custom BackButton view for this. When applying that view as leading navigation bar item, by doing: .navigationBarItems(leading: BackButton()) ...the navigation view looks like this: I've played around with modifiers like: .navigationBarItem(title: Text(""), titleDisplayMode: .automatic, hidesBackButton: true) without any luck. Question How can I... set a view used as custom back button in the

How do I change the color of the ActionBar hamburger icon?

孤街醉人 提交于 2019-11-29 06:59:04
I'm using NavigationView from android design support library and toolbar and everything works fine, but I want to know how to make the hamburger icon dark (right now it appears white). Also I wanna adjust distance from screen edge to ActionBar Title. So how do I do this? Thanks for help. I set theme as Theme.AppCompat.Light.NoActionBar. So I use toolbar. Here is my code: public class MainActivity extends AppCompatActivity { //Defining Variables private Toolbar toolbar; private NavigationView navigationView; private DrawerLayout drawerLayout; ViewPager pager; ViewPagerAdapter adapter;