First paste the source
Http://zrgiu.com/blog/2011/01/making-your-android-app-look-better/
Http://www.dibbus.com/2011/02/gradient-buttons-for-android/
Http://www.dibbus.com/2011/08/even-more-gradient-buttons-for-android/
Then let's take a look at the results. These are implemented in xml layout files, and none of them are used.
By the way, I will post several layout files for you to see:
Copy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Selector xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: state_pressed = "true">
<Shape>
<Solid
Android: color = "# 449def"/>
<Stroke
Android: width = "1dp"
Android: color = "#2f6699"/>
<Corners
Android: radius = "3dp"/>
<Padding
Android: left = "10dp"
Android: top = "10dp"
Android: right = "10dp"
Android: bottom = "10dp"/>
</Shape>
</Item>
<Item>
<Shape>
<Gradient
Android: startColor = "# 449def"
Android: endColor = "#2f6699"
Android: angle = "270" type = "parmname" text = "parmname"/>
<Stroke
Android: width = "1dp"
Android: color = "#2f6699"/>
<Corners
Android: radius = "4dp"/>
<Padding
Android: left = "10dp"
Android: top = "10dp"
Android: right = "10dp"
Android: bottom = "10dp"/>
</Shape>
</Item>
</Selector>
Copy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Shape xmlns: android = "http://schemas.android.com/apk/res/android”>
<Solid android: color = "# F000"/>
<Stroke android: width = "1px" android: color = "# BB000000"/>
<Padding
Android: left = "10dp"
Android: top = "7dp"
Android: right = "10dp"
Android: bottom = "7dp"
/>
<Corners
Android: bottomRightRadius = "5dp"
Android: bottomLeftRadius = "5dp"
Android: topLeftRadius = "5dp"
Android: topRightRadius = "5dp"
/>
<Gradient
Android: angle = "90 ″
Android: startColor = "#4747e0 ″
Android: centerColor = "# 5b5bcd"
Android: endColor = "# 6f6fcf"
Android: type = "linear"
/>
</Shape>
Here is an open-source project
Http://code.google.com/p/android-gradients-sample/downloads/list
By the way, these two web pages will be collected, so we may be able to provide inspiration or reference in the future.
Http://www.webdesignshock.com/css-button
Http://www.jb51.net/css/23418.html