2017-05-15 14 views
-3

ナビゲーション・ドロワーにScrollviewを渡すと、アンドロイド・スタジオでエラーが表示されます。この問題を解決するには?ナビゲーションドロワーの表示の問題

ナビゲーション・スクロール・ビューをスクロール・ビューに追加すると、エラーが発生し、カーソルをリダイレクトしますdrawer.closeDrawer(GravityCompat.START); MainActivity.javaの

+0

'NestedScrollView' – VishnuSP

+0

は、あなたがエラーを共有することができてお試しください?またはログcat出力。 –

+0

@AbhirojPanwar実際には、私がMainActivityに記載されている太字の行にエラーが表示されます。 –

答えて

0

このように試してみてください。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/top_parent" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:context=".Dashbored"> 

<include 
    android:id="@+id/tool_bar" 
    layout="@layout/tool_bar"> 

</include> 


<android.support.v4.widget.DrawerLayout 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@+id/tool_bar" 
    android:elevation="7dp" 
    android:fitsSystemWindows="true" 
    tools:openDrawer="end"> 


    <LinearLayout 
     android:id="@+id/linear_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 


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

      <include layout="@layout/f_home_screen" /> 

     </FrameLayout> 


    </LinearLayout> 

    <android.support.design.widget.NavigationView 
     android:id="@+id/nav_view" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:maxWidth="250dp" 
     android:layout_gravity="end" 
     android:background="#0284fe" 
     android:fitsSystemWindows="true"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical"> 

      <include 
       android:id="@+id/navheader" 
       layout="@layout/nav_header" /> 

      <ListView 
       android:id="@+id/lst_menu_items" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:divider="@null" 
       android:dividerHeight="0dp" 

       /> 
     </LinearLayout> 

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


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