ImageView vs ImageButton vs Button

In my layout, I have some images that need to be the background of a button (no text). I am confused as to how I should do this. There are several options for this -

  • Button
  • ImageButton
  • ImageView

Personally, I prefer ImageView, so I can scale the images accordingly and then set the onClickListener.

Am I missing something or are there performance issues with my approach? The pros and cons of each will help a lot.

Thanks and Regards



source to share

1 answer

There are many detailed answers to the question, but the 3 main differences in my opinion are 1.button - 3d rendering of a button with text. Very easy to use. 2. ImageButton - 3d rendeirng buttons, but instead of text you are using an image. 3. ImageView is a flat image.

ImageButton and Button have pressed, selected, focused, unselected states, which can convey different states of the button to the user.

I don't believe there are any performance benefits from using one vs the other, but there are definite UI and UX reasons for using each one. ImageView, I would guess it would be nice to only display the image. Users don't really know that they can draw the image. But with the help of counterpart buttons, users are taught that they need to pounce on them.



All Articles