Course Content

  • Android - UI ImageButton Control

Course Content


Mobile uses a lot of different controls in various forms. You can use ImageButton control to take input from users, you can also use it as an indicator for menu items in your app.

There are many benefits of using this control, some of the most important are:

  • The button is always visible and clickable.
  • It’s easy to add and remove content, such as images or text inside the button.
  • You can customize the text shown on the button by tweaking colors and fonts.

The ImageButton control works by detecting the device’s orientation. When the device is held in portrait mode, the button will display an image of a person and when it is rotated to landscape mode, it will display a map. The ImageButton control was first introduced on iOS 10 and macOS 10.13.

The ImageButton control is used to create interaction between the user and the app. For example, when a user clicks on the button, an image appears. When the user presses it again, a new image appears. This is in contrast to a Button control which simply displays text and does not visually interact with the users.

To add an icon to a button in an ImageButton control, use the ImageButtonIcon property. For example, this code snippet shows how you would add an image of a heart to the Add button in your ImageButton control:

  • ImageButtonIcon heart = new ImageButtonIcon("images/heart.png");
  • ImagebuttonControl.Add(heart);

The ImageView class is used to display any type of image resource in an Android app, whether it's an android. graphics. Bitmap or an android. graphics  ImageView can also be used to tint an image so that a drawable resource can be reused and overlays on background images can be created.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere