Android custom format display Button Layout

Source: Internet
Author: User

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

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.