drawable文件夹放置动画/形状/选择器等属性文件,唯一的drawable文件名,不允许写错和拼错,否则运行报错。drawable文件夹底下的xml文件可以包括的标签共18个:animation-list bitmap clip color corners gradient inset item(item) layout-list nine-patch padding rotate scale selector shape size solid stroke,18个标签中只有4个标签可以作为根标签:item(item) layout-list selector shape,比如:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" ><corners android:radius="5dp" />
<stroke
android:dashGap="3dp" android:dashWidth="3dp" android:width="1dp" android:color="#DC143C" /><size
android:height="20dp" android:width="20dp" /></shape>
文章来自: