I use the material navigation box in my android project using Xamarin. I am trying to add two Framelayouts to drawerlayout so that I can switch content from different fragments, see below 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" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/toolbar" android:id="@+id/toolbar" /> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:id="@+id/scrollview"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <FrameLayout android:id="@+id/search_frame" android:layout_width="match_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@+id/blah" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> </ScrollView> </LinearLayout> <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:menu="@menu/drawer_view" app:itemTextColor="#FFFFFF" app:itemIconTint="#FFFFFF" android:background="#464646"/> </android.support.v4.widget.DrawerLayout>
Primary activity:
protected override void OnCreate(Android_OS.Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.activity_main); drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
I get the following error: Android.Views.InflateException: binary line of XML file # 17: bloat error of android.support.design.internal.NavigationMenuItemView class
I tried moving elements in Drawerlayout, but the error is persistent. I looked at the documentation on Android, everything seems to be correct. I also verified that I have the latest version of the Design library and AppCompact
source share