according to recent Ian Lake post
And if you haven't looked at NavigationView recently, it actually got quite an update in version 23.1.0 [1] with the addition of app:actionLayout support for custom view support.
How can I use app:actionLayout
in NavigationView?
Using
<group android:checkableBehavior="single">
<item
android:id="@+id/navigation_drawer_item_1"
android:icon="@drawable/ic_menu_1"
android:title="@string/navigation_drawer_item_1"
app:actionLayout="@layout/menu_test_1"
/>
<item
android:id="@+id/navigation_drawer_item_2"
android:icon="@drawable/ic_menu_2"
android:title="@string/navigation_drawer_item_2"
app:actionLayout="@layout/menu_test_1"
/>
</group>
with
<android.support.design.widget.NavigationView android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer">
It doesn't work.
It shows the actionLayout on the right side of the item.
Also removing android:icon
and android:title
seems not working.
How can i fix it?
Thank you Regards