Working with Image Button Controls

The ImageButton control is a special type of button that displays a Drawable graphic instead of text. Figure 13.3 showed an ImageButton control used to display an avatar graphic as part of the settings screen.

The ImageButton and Button controls are both derived from the View class, but they are unrelated to each other otherwise. The Button class is actually a direct subclass of TextView (think of it as a line of text with a background graphic that looks like a button), whereas the ImageButton class is a direct subclass of ImageView.

Any graphics displayed within an ImageButton control should be stored locally on the handset. Attempting to use remote Uri addresses is not recommended due to decreased application performance and responsiveness.

Was this article helpful?

0 0

Post a comment