ImageView上的Android 144dp位图资源

时间:2014-12-24 18:58:37

标签: android image bitmap resources imageview

我想在ImageView(144dp)中显示一个大位图,但质量很差。位图存储在我的可绘制资源中。

我能以完整的质量显示位图吗?

Xml布局:

<ImageView
    android:layout_width="144dp"
    android:layout_height="144dp"
    android:src="@drawable/ic_add"/>

我想要的是什么:

http://tinypic.com/r/2jv72w/8

http://tinypic.com/r/2r7mtz4/8

我有什么:

http://tinypic.com/r/osh9qq/8

查看显示该列表为空的大图片。

1 个答案:

答案 0 :(得分:4)

使用更好的位图版本替换以下位置的ic_add文件,其大小与144dp代表的android密度存储区大小相同,如下所示:

folder (density buckets)       image dimensions
res/drawable-mdpi              144x144 px
res/drawable-hdpi              216x216 px
res/drawable-xhdpi             288x288 px
res/drawable-xxhdpi            432x432 px
res/drawable-xxxhdpi           576x576 px