[英]Vector image pixelated on the ImageView after changing build tools & gradle configuraiton?
I have a vector image added in my project the view is as follows: 我在项目中添加了矢量图像,视图如下:
<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" />
It working until now, I changed most of the Gradle dependencies from compile
to implementation
& changed Gradle
version to 3.2.2. 到现在为止,它一直有效,我将大多数Gradle依赖项从
compile
更改为implementation
,并将Gradle
版本更改为3.2.2。 After these changes studio suggested changing build tools to 28.0.3
I made the change then build the application, No errors reported during the build process. 在这些更改之后,Studio建议将构建工具更改为
28.0.3
,然后进行更改,然后构建应用程序,在构建过程中未报告任何错误。 But when the application was launched vector image appeared pixelated. 但是,当应用程序启动时,矢量图像显得像素化了。 What might have the build tool, grade changes having an effect on vector rendering?
生成工具可能有哪些,坡度变化会影响矢量渲染? How do I resolve this?
我该如何解决?
Update: 更新:
As soon as I reverted my build tools to 一旦我将构建工具还原为
buildToolsVersion "27.0.3"
& Support library versions to 和支持库版本
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
Vector image started showing up in good quality. 矢量图像开始以高质量显示。
try to use <android.support.v7.widget.AppCompatImageView>
instead od <ImageView>
. 尝试使用
<android.support.v7.widget.AppCompatImageView>
而不是od <ImageView>
。 And as already suggested, use srcCompat
instead of source
并且如已经建议的那样,使用
srcCompat
代替source
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.