ANTI_ALIAS_FLAG for ImageView within layout?

僤鯓⒐⒋嵵緔 提交于 2019-12-09 16:32:40

问题


Does anyone know how to apply the ANTI_ALIAS_FLAG to ImageView's in layouts rather than in Java?


回答1:


You want to apply the attribute android:antialias="true", like so:

<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" />



回答2:


2013-year-way: declare special xml resource describing ImageView's content. For example we want an ImageView to contain antialiased Bitmap. So we need to write somethig like this:

<bitmap 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:antialias="true"
    android:src="@drawable/ic_draggable_item"/>


来源:https://stackoverflow.com/questions/5488043/anti-alias-flag-for-imageview-within-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!