Create a graph row using android XML to reduce the dependency on the artist

Source: Internet
Author: User

Create a graph row using android XML to reduce the dependency on the artist
During development, you will always need to customize various View styles. If you always rely on the artist to draw the desired UI style image (for example, select a button and the default two images ), not only will time be wasted, but there will often be adaptation problems. Although some adaptation problems can be solved through the. 9 diagram, it still takes a lot of time. After all, the artist usually doesn't know how to create the. 9 diagram (You Have To Do It Yourself ). Therefore, you can create the UI style of the desired View by creating android XML in a simple way (not only quick, but no adaptation issues ).
The following XML Code creates a 4dip rounded corner with a 2px border (Start_use_btn_selector.xml ). (With three statuses: Click, select, and default)


 



Use in layout Android: layout_width = wrap_content
Android: layout_height = wrap_content
Android: background = @ drawable/start_use_btn_selector
Android: includeFontPadding = false
Android: paddingBottom = 2dip
Android: paddingLeft = 28dip
Android: paddingRight = 28dip
Android: paddingTop = 2dip
Android: text = Try now
Android: textColor = # FFFFFFFF
Android: textSize = 20sp/>

(Background green is the overall layout color)


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.