Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANTI_ALIAS_FLAG for ImageView within layout?

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

like image 922
Kevin Parker Avatar asked Mar 30 '11 14:03

Kevin Parker


2 Answers

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"/>
like image 74
Denis Gladkiy Avatar answered Nov 10 '22 01:11

Denis Gladkiy


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" />
like image 44
Chris Cashwell Avatar answered Nov 10 '22 00:11

Chris Cashwell