关于xml类型的背景文件的编写

来源:互联网 发布:mac终端bash 编辑:程序博客网 时间:2024/06/05 20:40

现在我只会用shape来写,

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

</shape>

把要写的效果放中间,然后选择标签慢慢加入


solid:背景颜色:例如:<solid android:color="#FFFF00"/>

stroke:边框颜色:例如:<stroke android:width="2dp" android:color="#333"/>

padding:设置边距:例如:<padding android:bottom="2dp" android:top="2dp"/>

corners:设置圆角:例如:<corners android:radius="10px"/>,android:topLeftRadius=""

gradient:设置渐变,当solid也在时,谁在后谁起作用,angle用来设置渐变的方向:例如:<gradient android:startColor="#fff" android:endColor="#000" android:angle="270"/>

0 0