Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Button with image, ImageButton, and clickable ImageView?

Is there any difference between Button with image, ImageButton and clickable ImageView?

like image 595
Snake Avatar asked Feb 23 '12 20:02

Snake


1 Answers

This probably only covers part of the differences, it would be helpful to actually look at the Android Source tree to see exactly what's going on.

ImageButtons has push states, where as a clickable image does not. You also can't call setText for ImageButton, you can with a regular button.

They all derive from view, but looking at the following extends chain may help a little.

java.lang.Object ↳ android.view.View    ↳ android.widget.ImageView        ↳ android.widget.ImageButton 

versus

java.lang.Object ↳ android.view.View    ↳ android.widget.TextView        ↳ android.widget.Button 
like image 123
Frank Sposaro Avatar answered Sep 23 '22 01:09

Frank Sposaro