Jeff Lee blog:http://www.cnblogs.com/alandre/(Mud brick Carpenter), retain the URL when reproduced! Thanks
Today we come to Android UI first: Implement layout background local shape fillet design
:
First step: Define a shape
Res/drawable/shape_to_corner_no_bottom_line.xml
<?xml version= "1.0" encoding= "Utf-8"? ><layer-list xmlns:android= "http://schemas.android.com/apk/res/ Android > <item> <!--shape with Circle-top corner-- <shape> <!--the shape Background color-to <solid android:color= "@color/black"/> <corners android:topleftradius= " 10DP "android:toprightradius=" 10DP " android:bottomleftradius=" 0.1DP "android:bottomrightradius=" 0.1DP "/> <stroke android:width= "1DP" android:color= "@color/black"/> </shape> </item> </layer-list>
Where the parameter means: {The English word is the name}
This is a detailed argument<!--rounded Corners-<Corners Android:radius= "9DP"Android:topleftradius= "2DP"Android:toprightradius= "2DP"Android:bottomleftradius= "2DP"Android:bottomrightradius= "2DP"/><!--Set the fillet radius-<!--gradient-<Gradient Android:startcolor= "@android: Color/white"Android:centercolor= "@android: Color/black"Android:endcolor= "@android: Color/black"Android:uselevel= "true"Android:angle= "45"Android:type= "Radial"Android:centerx= "0"Android:centery= "0"Android:gradientradius= "/>" <!--interval--<padding Android:left= "2DP"Android:top= "2DP"Android:right= "2DP"Android:bottom= "2DP"/><!--All directions--<!--size--<size Android:width= "50DP"Android:height= "50DP"/><!--width and height--<!--filled-in <Solid Android:color= "@android: color/white"/><!--filled colors-<!--strokes-<Stroke Android:width= "2DP"Android:color= "@android: Color/black"Android:dashwidth= "1DP"Android:dashgap= "2DP"/>Fill: Sets the color interval for the fill: sets the interval size in four directions: Set the size fillet: Set five properties at the same time, the Radius attribute is invalid Android:radius= "20DP"set the radius of the Four Corners Android:topleftradius= "20DP"sets the radius of the upper-left corner Android:toprightradius= "20DP"set the RADIUS android:bottomleftradius in the upper-right corner= "20DP"set the RADIUS android:bottomrightradius in the lower right corner= "20DP"set the radius stroke in the lower-left corner: The Dashwidth and Dashgap properties, as long as one is set to 0DP, the border is the implementation border Android:width= "20DP"sets the width of the edge Android:color= "@android: Color/black"sets the color of the edge android:dashwidth= "2DP"sets the width of the dashed line Android:dashgap= "20DP" Sets the interval width of the dashed line
Gradient: No gradient effect when the fill color is set. The value of the angle must be a multiple of 45 (including 0), only valid in type= "linear", or it will be an error. Android:uselevel This attribute does not know what is the use.
Step two: Setup in Layout
android:background= "@drawable/shape_to_corner_no_bottom_line"
So it's easy to set up.
Android UI (i) Layout background local shape fillet design