【发布时间】:2015-09-27 10:14:26
【问题描述】:
我试图在我的 NavigationView 中添加 Expandlistview,但它失败了。 我可以在标题下方添加布局吗?
activity_main 布局
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.NavigationView
android:id="@+id/navigation"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/header">
<ExpandableListView
android:id="@+id/expanded_menu"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
让我查看您的整个活动或您设置抽屉的部分
-
@Sree 我想添加像金属设计这样的标题
-
您可以有一个解决方案是,将固定宽度应用于标题布局的根元素,并为您的
ExpandableListView提供相同大小的marginTop。 -
不要使用NavigationView获取
标签: android android-support-library android-design-library navigationview