2017-04-08 13 views
-1

AndroidStudio.Butに添付されているDrawerLayoutを使用してアクティビティを作成しました。私はRecyclerViewを使用したときに、RecyclerViewが画面全体を埋めました...?DrawerLayoutはRecyclerViewと競合していますか? RecyclerViewは画面全体を塗りつぶします

<?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" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/drawer_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:openDrawer="start"> 
    <include 
     layout="@layout/app_bar_main" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 
    <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" /> 
    <android.support.v7.widget.RecyclerView 
     android:layout_marginTop="20dp" 
     android:id="@+id/titleList" 
     android:layout_width="match_parent" 
     android:layout_height="80dp"/> 
</android.support.v4.widget.DrawerLayout> 

The Button on the left top can't be used.Guess it was coverd by RecyclerView

dsajfhkjasldfkj

+0

。あなたは 'View'コンテンツにそれを置く必要があります。すなわち、 ''のレイアウトです。あなたはおそらく 'content_main'レイアウトを持っています。それはそこに行くだろう。 –

答えて

0

あなたのレイアウトは、このような構造にする必要があります:あなたはそこにあなたの `RecyclerView`をしたくない

​​
+0

ありがとうございました...私はそれを解決しました –

+0

あなたは私の答えにあなたの問題を解決することができたことをうれしく思います。しかし、それがあなたを助けた場合、あなたがアップフォートして、そして/または私の答えをマークすることは素晴らしいでしょう:) –

関連する問題