-1
我正在開發android應用程序。在我的應用程序中,我使用了NavigationView。但它顯示主要xml文件中的InflateException,並且應用程序被關閉。android.view.inflateexception二進制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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" xmlns:app1="http://schemas.android.com/apk/res/com.example.xpressownernew">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- The ActionBar -->
<include
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- The main content view -->
<FrameLayout
android:id="@+id/flContent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- The navigation drawer -->
<android.support.design.widget.NavigationView
android:id="@+id/nvView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
app:menu="@menu/drawer_view"
app:headerLayout="@layout/nav_header"
/>
</android.support.v4.widget.DrawerLayout>
如何解決這個問題呢?
用完整的Stace Trace發佈你的代碼。 –
需要stacktrace,drawer_view.xml和你的nav_header。 xml ..... – Opiatefuchs
你只給了部分信息。發佈您的logcat和其他xml文件 – AADProgramming