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)