2
如何在NavigationView
中更改标题视图高度?我旁边的xml: activity_main.xml中如何在NavigationView中更改标题高度?
<android.support.v4.widget.DrawerLayout
android:id="@+id/dlDrawerContainer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.MainActivity"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- Some data -->
<!-- Drawer -->
<android.support.design.widget.NavigationView
android:fitsSystemWindows="true"
android:id="@+id/nvNavigation"
android:layout_width="wrap_content"
android:maxWidth="400dp"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/navigation_header"/>
</android.support.v4.widget.DrawerLayout>
navigation_header.xml
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxWidth="400dp"
android:maxHeight="100dp"
android:scaleType="matrix"/>
但NavigationView
忽略所有维度属性,并显示了默认大小头。如何解决它?
如何使用WRAP_CONTENT为'ImageView'。它不适用于'NavigationView'。我的ImageView'填充最大父母高度都一样。 –
对不起,但我不明白你想达到什么。可以编辑你的问题,并澄清什么是预期的结果,也许与图像? –