Android Selector shape using

Source: Internet
Author: User

First on

Message_toolbar_left_bg_selector

<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/  Android "> <item android:state_selected=" true "> <shape> <size android:width=" 69.0DP " android:height= "27DP"/> <!--line width, color gray---<stroke android:width= "0.5DP" Android:color = "@color/orange" ></stroke> < fillet radius of!--rectangle--<corners android:bottomleftradius= "10. 0DP "android:bottomrightradius=" 0.0DP "android:topleftradius=" 10.0DP "android:toprightradius=" 0.0DP "/> < Solid android:color= "@color/orange"/> </shape> </item> <item android:state_pressed= "true" &        Gt            <shape> <size android:width= "69.0DP" android:height= "27DP"/> <!--line width, color gray-- <stroke android:width= "0.5DP" android:color= "@color/orange" ></stroke> <!--rectangle fillet radius--&            Gt <corners Android:bottomleftradius= "10.0DP" android:bottomrightradius= "0.0DP" android:topleftradius= "10.0DP" Android: toprightradius= "0.0DP"/> <solid android:color= "@color/orange"/> </shape> &LT;/ITEM&G    T <item android:state_checked= "true" > <shape> <size android:width= "69.0DP" android:height= " 27DP "/> <!--line width, color gray--<stroke android:width=" 0.5DP "android:color=" @color/orange "& gt;</stroke> <!--Corner radius of Rectangle--<corners android:bottomleftradius= "10.0DP" Android:bott omrightradius= "0.0DP" android:topleftradius= "10.0DP" android:toprightradius= "0.0DP"/> <solid android:col Or= "@color/orange"/> </shape> </item> <item> <shape> <size A Ndroid:width= "69.0DP" android:height= "27DP"/> <!--line width, color gray---<stroke android:width= "0.5DP" android:color= "@color/oranGE "></stroke> <!--rounded radii of rectangles--<corners android:bottomleftradius=" 10.0DP "Android: bottomrightradius= "0.0DP" android:topleftradius= "10.0DP" android:toprightradius= "0.0DP"/> <solid Android : color= "@color/white"/></shape> </item></selector>

  

Message_toolbar_right_bg_selector

<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/  Android "> <item android:state_selected=" true "> <shape> <size android:width=" 69.0DP " android:height= "27DP"/> <!--line width, color gray---<stroke android:width= "0.5DP" Android:color = "@color/orange" ></stroke> < fillet radius of!--rectangle--< Corner radius of!--rectangle--<cor Ners android:bottomleftradius= "0.0DP" android:bottomrightradius= "10.0DP" android:topleftradius= "0.0DP" Android: toprightradius= "10.0DP"/> <solid android:color= "@color/orange"/> </shape> </item&    Gt <item android:state_pressed= "true" > <shape> <size android:width= "69.0DP" android:height= " 27DP "/> <!--line width, color gray--<stroke android:width=" 0.5DP "android:color=" @color/orange "& gt;</stroke> <!--rounded corners of rectanglesRadius-<!--corner radius of the rectangle-<corners android:bottomleftradius= "0.0DP" Android:bottomrightrad ius= "10.0DP" android:topleftradius= "0.0DP" android:toprightradius= "10.0DP"/> <solid android:color= "@colo            R/orange "/> </shape> </item> <item android:state_checked=" true "> <shape> <size android:width= "69.0DP" android:height= "27DP"/> <!--line width, color gray---<s            Troke android:width= "0.5DP" android:color= "@color/orange" ></stroke> < rounded corner radius of!--Rectangle-- <!--corner radius of the rectangle--<corners android:bottomleftradius= "0.0DP" android:bottomrightradius= "10.0DP" Android:        topleftradius= "0.0DP" android:toprightradius= "10.0DP"/> <solid android:color= "@color/orange"/> </shape> </item> <item> <shape> <size android:width= "69.0DP" Android:     height= "27DP"/>       <!--line width, color gray--<stroke android:width= "0.5DP" android:color= "@color/orange" &GT;&LT;/STROKE&G            T <!--corner radius of the rectangle--<corners android:bottomleftradius= "0.0DP" android:bottomrightradius= "10.0DP" Android:        topleftradius= "0.0DP" android:toprightradius= "10.0DP"/> <solid android:color= "@color/white"/> </shape> </item></selector>

Layout Interface

 <radiogroup android:id= "@id/rg_group" android:layout_width= "138.0DP" Android:layout_h            eight= "27.0DP" android:layout_centerinparent= "true" android:orientation= "Horizontal" >                <radiobutton android:id= "@id/rbtn_message" android:layout_width= "Match_parent"                android:layout_height= "Match_parent" android:layout_weight= "1" android:button= "@null" Android:checked= "true" android:gravity= "center" android:background= "@drawable/ Message_toolbar_left_bg_selector "android:text=" Heading 1 "android:textcolor=" @color/message_toolb Ar_font_color "/> <radiobutton android:id=" @id/rbtn_chat_room "Android:layo                Ut_width= "Match_parent" android:layout_height= "Match_parent" android:layout_weight= "1" Android:button= "@null" android:gravity= "center" android:background= "@drawable/message_toolbar_right_bg_sel        Ector "android:text=" Heading 2 "android:textcolor=" @color/message_toolbar_font_color "/> </RadioGroup>

  

Android Selector shape using

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.