android - 抽屉导航器内的矢量图像不会因不同的屏幕分辨率而改变
问题描述
我在抽屉导航器内的图像视图中使用矢量资产。但是此图像不会针对不同的屏幕分辨率更改大小。这是抽屉导航器的代码。我在这里使用 2 个抽屉导航器来对齐菜单底部
<?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">
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_gravity="center"
app:srcCompat="@drawable/ic_logo" />
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:fitsSystemWindows="true"
app:menu="@menu/activity_main_drawer">
<TextView
android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:clickable="true"
android:gravity="bottom"
android:onClick="onClick"
android:textColor="@color/cardview_dark_background" />
</android.support.design.widget.NavigationView>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
我尝试了很多方法,但仍然没有找到解决方案。请帮忙
解决方案
推荐阅读
- sql - 在创建依赖视图时授予问题
- c++ - 在 qt QFileDialog setsuffix 在 linux 中不起作用,如何解决?
- asp.net - IIS 重写 - 匹配 URL 覆盖
- bash - 为什么将参数从管道传递给函数时,结果会有所不同?
- mysql - 如何通过 R 代码设置 sql 分隔符?
- jenkins - Docker 映像无法在 Jenkins Kubernetes 构建管道中保持活力
- python - 想使用循环按索引添加值
- java - 当请求检索所有记录时,数据库返回相同的记录
- python - 使用 Python 遍历目录中的文件 - 代码不起作用
- mysql - 两个不同表中的 UPDATE 和 SELECT ORDER