Android custom images via XML

Source: Internet
Author: User

<?xml version= "1.0" encoding= "Utf-8"?>
<shape
Xmlns:android= "Http://schemas.android.com/apk/res/android"
android:shape=["Rectangle" | "Oval" | "Line" | "Ring"] >---default to Rectangle
<corners--shape= "rectangle" when used,
android:radius= "integer"-radius, will be overridden by the properties below, default to 1DP,
android:topleftradius= "Integer"
android:toprightradius= "Integer"
android:bottomleftradius= "Integer"
android:bottomrightradius= "integer"/>
<gradient--Gradient
Android:angle= "Integer"
android:centerx= "Integer"
android:centery= "Integer"
Android:centercolor= "Integer"
android:endcolor= "Color"
android:gradientradius= "Integer"
android:startcolor= "Color"
android:type=["Linear" | "Radial" | "Sweep"]
Android:uselevel=["true" | "False"]/>
<padding
android:left= "Integer"
android:top= "Integer"
android:right= "Integer"
android:bottom= "integer"/>
<size--Specifies the size, generally used in the ImageView mate ScaleType attribute. The size is usually adapted to the drip
Android:width= "Integer"
android:height= "integer"/>
<solid--fill color, but hexadecimal color. (For example, if you want to set a translucent effect, use 16 directly just OK)
android:color= "Color"/>
<stroke--Specify the border, Border,dashwidth and Dashgap have a 0DP
Android:width= "Integer"
android:color= "Color"
Android:dashwidth= "integer"--Dashed width
android:dashgap= "integer"/>--dash interval width
</shape>

Android custom images via XML

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.