我在我的项目中添加了一个向量图像,视图如下:
<ImageView
android:id="@+id/logo"
android:layout_width="252dp"
android:layout_below="@id/display_id_tv"
android:layout_height="57dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:scaleType="fitXY"
android:src="@drawable/ic_vector_image" />到目前为止,我将大多数Gradle依赖关系从compile更改为implementation &将Gradle版本更改为3.2.2。在这些更改之后,studio建议将构建工具更改为28.0.3,然后进行更改,然后构建应用程序,在构建过程中没有报告错误。但是,当应用程序启动时,矢量图像出现像素化。什么可能有构建工具,等级变化对矢量渲染有影响?我该怎么解决这个问题?
更新:
一旦我把我的构建工具恢复到
buildToolsVersion "27.0.3"&支持库版本到
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'矢量图像开始以良好的质量显示。
发布于 2019-03-06 08:12:48
尝试使用<android.support.v7.widget.AppCompatImageView>而不是od <ImageView>。正如前面所建议的,使用srcCompat而不是source
https://stackoverflow.com/questions/55017826
复制相似问题