(Android Control) page to configure the perspective effect button

Source: Internet
Author: User
1. Implementation results

Button normal effect

 

Button-click Validity Period

 

2. Now the pivot effect button

The button for implementing the perspective effect focuses on two points:

1. Button background implementation

2. Button font color implementation

 

2.1 button background implementation

The Perspective color is mainly added to the background color value.AlphaValue

Button perspective Implementation

<?xml version="1.0" encoding="utf-8"?><shape    xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle"    android:useLevel="false">  <padding    android:left="10px"    android:top="5px"    android:bottom="5px"    android:right="10px"  />   <corners     android:radius="10px"    />  <solid    android:color="#7fE6E6E6"    ></solid></shape>

 

Button click background implementation
<?xml version="1.0" encoding="utf-8"?><shape    xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle"    android:useLevel="false">  <padding    android:left="10px"    android:top="5px"    android:bottom="5px"    android:right="10px"/>     <corners     android:radius="10px"/>  <solid      android:color="#0040FF"></solid></shape>

 

2.2 button font color implementation
<?xml version="1.0" encoding="utf-8"?><selector  xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_window_focused="false" android:color="@color/black"></item><item android:state_pressed="true" android:color="@color/white"></item><item  android:color="@color/black"></item></selector>

 

 

Small application to achieve the above effect [Sports weight calculator]

Application: http://www.appchina.com/soft_detail_275718_0_10.html

Http://static.apk.hiapk.com/html/2012/05/576305.html market for Android

 

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.