[英]Android Icon is pixelated/ blurry
我在Android Asset Studio上加载了一个图标。
它创建了我mdpi,hdpix hdpi,xxhdpi和xxxhdpi图标
但图标像素化和模糊:(
这里的代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img"
android:layout_width="144dp"
android:layout_height="144dp"
android:layout_margin="16dp"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
尝试矢量图形。
这将缩放到您想要的任何尺寸而不会模糊。 将图形保存为.SVG,然后您可以将其转换为Android Vector Drawable .XML文件(转换器的Google“SVG to Vector Convertor”)。
将生成的.XML Android Vector Drawable放在res\\drawable
文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.