1. Different inheritance:
Java. Lang. Object-> Android. View. View-> Android. widget. imageview-> Android. widget. imagebutton
Java. Lang. Object-> Android. View. View-> Android. widget. textview-> Android. widget. Button
Therefore, imagebutton does not support settext, whereas button does. Conversely, imagebutton supports setimageuri, while button does not. Button and imagebutton have the button status, but imageview does not.
2. Display differences:
The clickable attributes of imageview also implement the button clicking function, so there is no difference. However, recently I made a listview, an imagebutton, and an imageview to display the rounded corner image, imagebotton cannot be displayed.
Imagebutton has the Default background:
<Style name = "widget. imagebutton "> <item name =" Android: focusable "> true </item> <item name =" Android: clickable "> true </item> <item name =" Android: scaletype "> center </item> <item name =" Android: background "> @ Android: drawable/btn_default </item> </style>
To remove the Default background of imagebutton:
<! -- The layout_width and layout_height attributes must be wrap_content, otherwise the border will still display --> <imagebutton Android: Id = "@ + ID/iblogin" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: src = "@ drawable/btn_login" Android: adjustviewbounds = "true" Android: padding = "0dp"/>
Citation:
Http://blog.csdn.net/zapzqc/article/details/8497210
Http://www.androidlearner.net/android-delete-whiteframe-imagebutton.html