public class

ImageButton

extends ImageView
java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ImageView
       ↳ android.widget.ImageButton
Known Direct Subclasses

Class Overview

An image button displays an image that can be pressed, or clicked, by the user.

XML attributes

See Button Attributes, View Attributes

Summary

[Expand]
Inherited XML Attributes
From class android.widget.ImageView
From class android.view.View
[Expand]
Inherited Constants
From class android.view.View
Public Constructors
ImageButton(Context context)
ImageButton(Context context, AttributeSet attrs)
ImageButton(Context context, AttributeSet attrs, int defStyle)
Protected Methods
boolean onSetAlpha(int alpha)
Invoked if there is a Transform that involves alpha.
[Expand]
Inherited Methods
From class android.widget.ImageView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback

Public Constructors

public ImageButton (Context context)

public ImageButton (Context context, AttributeSet attrs)

public ImageButton (Context context, AttributeSet attrs, int defStyle)

Protected Methods

protected boolean onSetAlpha (int alpha)

Invoked if there is a Transform that involves alpha. Subclass that can draw themselves with the specified alpha should return true, and then respect that alpha when their onDraw() is called. If this returns false then the view may be redirected to draw into an offscreen buffer to fulfill the request, which will look fine, but may be slower than if the subclass handles it internally. The default implementation returns false.

Parameters
alpha The alpha (0..255) to apply to the view's drawing
Returns
  • true if the view can draw with the specified alpha.