1
私はDrawerLayout上のメニュー項目のカスタムレイアウトを添付しようとしているためカスタムレイアウト上の全幅を設定していますが、ご覧のように、メニュー項目は、全幅を持っていないと私は、この問題Androidのメニュー
に解決することはできませんcreate_new
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="25dp"
android:text="New Text"
android:gravity="left|center"
android:layout_marginLeft="20dp"
android:background="#000"
android:textColor="#fff"/>
</LinearLayout>
として
マイメニューレイアウト
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<group android:id="@+id/groupOne">
<item
android:id="@+id/inbox"
app:actionLayout="@layout/create_new"/>
</group>
</menu>
とそのための私のカスタムレイアウト
これで運がいいですか? –