xml - How to add custom style to menu items in Android Studio? -
i made navigation drawer following youtube video.
here activity_main.xml
<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.navigationview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:background="@color/menucolor" app:headerlayout="@layout/header" app:itemicontint="@color/white" app:itemtextcolor="@color/white" app:paddingstart="20px" app:menu="@menu/drawermenu"> </android.support.design.widget.navigationview> </android.support.v4.widget.drawerlayout>
and here custom drawermenu.xml
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/title" android:title="title" android:layout_gravity="center"/> <item android:id="@+id/first" android:title="first item" /> <item android:id="@+id/second" android:title="second item" android:layout_gravity="center"/>
how can add custom fonts , font sizes items - making "title" size of 26sp , other items size of 18sp. how can make them centered , add padding it?
i tried doing design interface doesn't have of options. using android:layout_gravity="center" did not work me either.
try having
android:actionmenutextappearance
item under action bar style, move under app theme.
Comments
Post a Comment