Roombutton of Androidui Components

Source: Internet
Author: User

<!--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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.