Button, circle button, image button with text, circle button

Source: Internet
Author: User

Button, circle button, image button with text, circle button

 

Demo2 \ button_demo \ src \ main \ res \ drawable \ button_selector.xml

1 <?xml version="1.0" encoding="utf-8"?>2 <selector xmlns:android="http://schemas.android.com/apk/res/android">3     <item android:state_pressed="true" android:drawable="@mipmap/favoured_icon"></item>4     <item android:state_pressed="false" android:drawable="@mipmap/s_rate_crown"></item>5 </selector>

 

Demo2 \ button_demo \ src \ main \ res \ layout \ activity_main.xml

1 <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" 2 xmlns: tools = "http://schemas.android.com/tools" 3 android: layout_width = "match_parent" 4 android: layout_height = "match_parent" 5 android: orientation = "vertical" 6 tools: context = ". mainActivity "> 7 <! -- Text shadow Button --> 8 <Button 9 android: layout_width = "wrap_content" 10 android: layout_height = "wrap_content" 11 android: shadowColor = "# aa5" 12 android: shadowDx = "5" 13 android: shadowDy = "5" 14 android: shadowRadius = "1" 15 android: text = "text shadowRadius =" 16 android: textSize = "12dp"/> 17 <! -- Normal text button --> 18 <Button19 android: layout_width = "wrap_content" 20 android: layout_height = "wrap_content" 21 android: background = "# ff1827" 22 android: text = "normal button" 23 android: textSize = "10dp"/> 24 <! -- Image button with text --> 25 <Button26 android: layout_width = "wrap_content" 27 android: layout_height = "wrap_content" 28 android: background = "@ drawable/button_selector" 29 android: text = "text-carrying image buttons" 30 android: textSize = "11dp"/> 31 </LinearLayout>

 

Related Article

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.