Android round button implementation

Source: Internet
Author: User

The circular button used in the project, which is a half-day, is implemented in sharp form with the following style code:

<Buttonandroid:id="@+id/btn_5"Android:layout_width="wrap_content"Android:layout_height="wrap_content"android:layout_gravity="Center"Android:text="@string/general_consulting"Android:textcolor="@color/white"android:textsize="@dimen/text_size18"Android:background="@drawable/bg_special_disease_circle"/>

Others do not care, background Bg_special_disease_circle.xml style code is as follows:

<?xml version="1.0"encoding="Utf-8"? ><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="Oval"> <corners android:radius="@dimen/size90"/> <solid android:color="@color/white"/> <size android:width="170DP"android:height="170DP"/> </shape> </item> <item android:bottom="8DP"android:right="8DP"android:top="8DP"android:left="8DP"> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape android:shape="Oval"> <corners android:radius="@dimen/size90"/> <solid android:color="#e66b4f"/> <size android:width="162DP"android:height="162DP"/> </shape> </item> <item> <shape Android:shape="Oval"> <corners android:radius="@dimen/size90"/> <solid android:color="#f3876f"/> <size android:width="162DP"android:height="162DP"/> </shape> </item> </selector> </item> </lay Er-list>

Android round button implementation

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.