2016-09-23 1 views
2

내 앱에서 탐색보기 및 서랍 레이아웃을 사용하고 있습니다. 나는 예외를 던지면서 던지기를 실행하려고 노력했다. 그것이 지원하는 MinSdk는 14입니다.탐색보기에 대한 팽창 예외 발생

또한 사용하고있는 테마는 appcompact no action bar입니다.

주요 활동 :

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/container"> 
    </FrameLayout> 

    <!-- Your normal content view --> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:id = "@+id/toolbar_container"> 

     <!-- We use a Toolbar so that our drawer can be displayed 
      in front of the action bar --> 
     <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/main_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 

      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/Contacts" 
      android:layout_gravity="center" 
      android:id="@+id/toolbar_title" 
      android:textSize="20sp" 
      android:textColor="#ffffff" 
      android:textStyle="bold" 
      android:gravity="center" /> 
     </android.support.v7.widget.Toolbar> 

     <android.support.v7.widget.RecyclerView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:background="#ffffff" 
      android:id="@+id/recycler_view" 
      android:layout_alignParentStart="true" 
      android:layout_alignParentLeft="true" /> 
     <!-- The rest of your content view --> 

    </LinearLayout> 

    <android.support.design.widget.NavigationView 
     android:id="@+id/navigation_view" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:fitsSystemWindows="true" 
     android:background="?attr/colorPrimary" 
     app:headerLayout="@layout/drawer_header" 
     app:itemTextColor="@color/yourColor" 
     app:itemIconTint="@color/yourColor" 
     app:menu="@menu/nav_menu" > 
     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <include 
       layout="@layout/drawer_header" 
       android:layout_width="match_parent" 
       android:layout_height="103dp" /> 

      <ExpandableListView 

       android:id="@+id/elvGuideNavigation" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:groupIndicator="@null" 
       /> 

     </LinearLayout> 

    </android.support.design.widget.NavigationView> 



</android.support.v4.widget.DrawerLayout> 

예외 :

android.view.InflateException: Binary XML file line #56: Error inflating class android.support.design.widget.NavigationView 
+0

은이 링크 http://stackoverflow.com/questions/30709419/error-inflating-class-android-support-design-widget-navigationview 내가 당신에게 –

답변

0

당신은 DrawerLayout 내에서 두 개의 레이아웃을 사용해야합니다. 메인 콘텐츠 레이아웃 하나, 서랍 레이아웃 (예 : NavigationView). 현재 세 가지 레이아웃이 있습니다. Framelayout을 제거하고 코드를 실행 해보십시오.

+0

을하는 데 도움이 생각 나는 또한이 같은 그 충격입니다을 확인 했 코드는 이전 버전에서 작동합니다. @Srijith N – Sid

+0

여전히 프레임 레이아웃을 제거하여 예외가 발생했습니다. @ Srijith N – Sid

+0

xml을 확인하겠습니다. – Srijith