有誰知道如何在佈局而不是Java中應用ANTI_ALIAS_FLAG
到ImageView
?ANTI_ALIAS_FLAG用於佈局中的ImageView?
7
A
回答
6
要應用屬性android:antialias="true"
,就像這樣:
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:antialias="true" />
5
2013年的方法:申報特殊的XML資源描述的ImageView內容。例如,我們希望ImageView包含反鋸齒位圖。所以我們需要寫下如下的東西:
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:antialias="true"
android:src="@drawable/ic_draggable_item"/>
+1
呃。這是令人討厭的API變化。 – greg7gkb 2014-05-09 00:17:32
@Kevin:沒問題,很高興我能幫忙。 – 2011-03-30 15:43:14
android:antialias不適用於imageView! – Pablo 2013-02-05 21:31:08
@Pablo,2年前,當它被回答時,它確實如此。因此,OP的感謝評論和其他用戶的贊成票。但是,是的。感謝您指出在事實發生近兩年後它已從API中刪除。 – 2013-02-06 06:46:39