<!--knowledge Points: 1. The difference between button and ImageButton is that the button generates the text on the buttons and displays the picture on ImageButton. It should be noted that specifying the Android:text property for the ImageButton button is useless (ImageButton is ImageView), and even if the attribute is specified, no text is displayed on the Picture button 2, ImageButton A Zoombutton is derived, and the Zoombutton can represent "zoom in", "Zoom Out" two buttons. Zoombutton's behavior is basically similar to ImageButton, but Android provides Btn_minus, btn_plus two drawable resources by default, as long as Zoombutton ANDROID:SRC properties are specified separately Btn_ Minus, Btn_plus, you can achieve "zoom in", "Zoom Out" button 3, Android also provides a zoomcontrols component, which is equivalent to combining the "zoom in", "Zoom Out" two buttons, and allow two buttons to bind different events-- <linearlayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "Android:orien tation= "Vertical" > <!--Normal Picture button--<imagebutton android:layout_width= "80DP" android:l ayout_height= "80DP" android:src= "@drawable/blue"/> <!--buttons to display different pictures when pressed--<imagebutton Android:layout_width= "80DP" android:layout_height= "80DP" android:src= "@dRawable/button_selector "/> <linearlayout android:orientation=" Horizontal "android:layout_w Idth= "Wrap_content" android:layout_height= "wrap_content" android:layout_margin= "10SP" Android:layout_ gravity= "Center_horizontal" > <!--define 2 Zoombutton respectively and appear to use Btn_minus and btn_plus images--<zoomb Utton android:layout_width= "wrap_content" android:layout_height= "Wrap_content" android:i D= "@+id/btn_zoom_down" android:src= "@android:d rawable/btn_minus"/> <zoombutton Android:layout_width= "Wrap_content" android:layout_height= "wrap_content" android:id= "@+id/btn_z Oom_up "android:src=" @android:d rawable/btn_plus "/> </LinearLayout> <!--definition Zoomcon Trols Components--<zoomcontrols android:id= "@+id/zoomcontrols1" android:layout_width= "Wrap_content" a Ndroid:layout_height= "WRAp_content "android:layout_gravity=" Center_horizontal "/></linearlayout>
Show effect
Reprint Please specify source: http://blog.csdn.net/android_jiangjun/article/details/25341727