Skip to content

Most visited

Recently visited

navigation
added in version 25.4.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

ImageViewCompat

public class ImageViewCompat
extends Object

java.lang.Object
   ↳ android.support.v4.widget.ImageViewCompat


Helper for accessing features in ImageView.

Summary

Public methods

static ColorStateList getImageTintList(ImageView view)

Return the tint applied to the image drawable, if specified.

static PorterDuff.Mode getImageTintMode(ImageView view)

Return the blending mode used to apply the tint to the image drawable, if specified.

static void setImageTintList(ImageView view, ColorStateList tintList)

Applies a tint to the image drawable.

static void setImageTintMode(ImageView view, PorterDuff.Mode mode)

Specifies the blending mode used to apply the tint specified by setImageTintList(android.widget.ImageView, android.content.res.ColorStateList) to the image drawable.

Inherited methods

From class java.lang.Object

Public methods

getImageTintList

added in version 25.4.0
ColorStateList getImageTintList (ImageView view)

Return the tint applied to the image drawable, if specified.

Parameters
view ImageView

Returns
ColorStateList

getImageTintMode

added in version 25.4.0
PorterDuff.Mode getImageTintMode (ImageView view)

Return the blending mode used to apply the tint to the image drawable, if specified.

Parameters
view ImageView

Returns
PorterDuff.Mode

setImageTintList

added in version 25.4.0
void setImageTintList (ImageView view, 
                ColorStateList tintList)

Applies a tint to the image drawable.

Parameters
view ImageView

tintList ColorStateList

setImageTintMode

added in version 25.4.0
void setImageTintMode (ImageView view, 
                PorterDuff.Mode mode)

Specifies the blending mode used to apply the tint specified by setImageTintList(android.widget.ImageView, android.content.res.ColorStateList) to the image drawable. The default mode is SRC_IN.

Parameters
view ImageView

mode PorterDuff.Mode

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)