Hello everyone, pls call me Francis. Nice to me.
This article describes using the shape tag in Android to draw a drawable resource picture.
The following code is the basic usage of the SHAP tag:
<?xml version="1.0"encoding="Utf-8"? ><shape xmlns:android="http://schemas.android.com/apk/res/android"Android:shape="Rectangle "> <!--Android:shape property values are: Rectangle (Rectangle) (default), oval (oval), line (lines), Ring (ring)--<!--graditent (gradient), drawing a color gradient effect -<gradient android:angle=" -"Android:endcolor="#000000"Android:centercolor="#777777"Android:startcolor="#ffffff"/> <!--corners (corner, corner) Draw Corner Smoothing effects-<corners android:radius="30DP"/> <!--padding (padding, padding, filling) Draw text content with this drawable padding, with a white effect--<padding android:left="10DP"/> <!--solid (solid) Fill Color-<solid android:color="#ff0000"/> <!--stroke (stroke) Draw a border effect-<!--android:dashwidth indicates the length of the dashed line, android:dashgap indicates the distance between dashes, and <str Oke android:width="5DP"Android:color="#00ff00"Android:dashwidth="30DP"android:dashgap="2DP"/> </shape>
This is the process of shape making drawable resources, this is a picture of drawable. The picture has been created!
Next, we'll use it to look at it and name the previous generation: Shape_ring.xml.
As long as we are so used in layout layouts: android:background= "@drawable/shape_ring".
OK, above is the whole process of our study.
It's easy, ^_^.
Attached:
Android Series: Res shape making