我正在尝试将我自己的自定义标题视图添加到 Google 的新视图NavigationView
中,但出于某种原因,无论我做什么,Android Studio 都会给我一个警告include
,并且RelativeLayout
此处不允许。我试着做
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<include layout="@layout/nav_drawer_header" />
<android.support.v7.widget.RecyclerView
android:id="@+id/nav_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cccc"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"/>
</android.support.design.widget.NavigationView>
但只有RecyclerView
出现,我不知道还能做什么。
我真的很感激一些帮助。谢谢!