Android selector 的shape、gradient、stroke、corners 、state_pressed等属性嵌套写法
来源:互联网 发布:linux mint 18如何使用 编辑:程序博客网 时间:2024/04/30 01:38
http://www.360doc.com/content/12/0628/09/9325001_220896387.shtml
对于一个Button完整的定义可以为
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#ff8c00"
android:endColor="#FFFFFF"
android:angle="270" />
<stroke
android:width="2dp"
android:color="#dcdcdc" />
<corners
android:radius="2dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<gradient
android:startColor="#ffc2b7"
android:endColor="#ffc2b7"
android:angle="270" />
<stroke
android:width="2dp"
android:color="#dcdcdc" />
<corners
android:radius="2dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#ff9d77"
android:endColor="#ff9d77"
android:angle="270" />
<stroke
android:width="2dp"
android:color="#fad3cf" />
<corners
android:radius="2dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
在button定义的地方直接设置android:background="@xml/。。。“//。。上面xml名称
- Android selector 的shape、gradient、stroke、corners 、state_pressed等属性嵌套写法
- Android selector 的shape、gradient、stroke、corners 、state_pressed等属性嵌套写法
- Android shape、gradient、stroke、corners 、state_pressed研究
- Android--shape-指定图形的corners、gradient、padding、size、solid、stroke属性
- Android代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android 代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android代码设置Shape,corners,Gradient
- Android UI设计 按钮美化,gradient,stroke,corners
- android关于shape的gradient属性详解
- android关于shape的gradient属性详解
- android关于shape的gradient属性详解
- Shape的gradient属性
- Android代码设置Shape,corners,Gradient(转载)
- 添加去APP store评论
- oracle11g 安装图解
- MVC框架浅析
- android 的mediaPlayer一些属性
- xml写动画
- Android selector 的shape、gradient、stroke、corners 、state_pressed等属性嵌套写法
- 堆排序算法分析
- Python推荐博客、网站学习
- C# webbrowser实现百度知道团队邀请助手!
- Hadoop超级安装手册
- Could not read the EEPROM; something fundamentally wrong on the I2C bus
- WebLogic如何设置session超时时间
- SPI和API的区别
- Literal Regular Expression in Source Code (代码中的字面正则表达式)