Android Rounded Rectangle, gradient color, custom
First, write an XML in the drawable directory, with the name random (as long as the specification is met), the code is as follows:
<span style= "color: #009900;" ><span style= "Background-color:rgb (255, 255, 255); ><?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "http://schemas.android.com/apk/res/ Android " android:shape=" Rectangle "> <gradient android:angle=" android:startcolor= " # 19b001 " android:endcolor=" #19B001 "/> <corners android:bottomleftradius=" @dimen/dp5 " android:bottomrightradius= "@dimen/dp5" android:topleftradius= "@dimen/dp5" android:toprightradius= "@ DIMEN/DP5 "/></shape></span><span style=" font-size:10px; ></span></span>
- Shape represents the form of graphics, mainly including squares, circles, etc., the upper code is square ,
- Gradient represents the primary configuration start color, end color, and middle point color, coordinates, gradient effect (0, page, gradient from left to right, top to bottom gradient) default left to right Padding represents the spacing between the top and bottom left and right of the main configuration
- Corners represents the radius of the configuration around the garden foot
- then, you are in the code or XML the layout uses it like a picture.
Android Rounded rectangle with background color