ANTI_ALIAS_FLAG for ImageView within layout?

2019-04-06 16:25发布

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

2条回答
Melony?
2楼-- · 2019-04-06 17:03

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" />
查看更多
Summer. ? 凉城
3楼-- · 2019-04-06 17:07

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"/>
查看更多
登录 后发表回答