android中shape的使用
来源:互联网 发布:壁虎数据恢复免root版 编辑:程序博客网 时间:2024/06/06 11:02
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!--
gradient渐变
angle是渐变角度,必须为45的整数倍 -->
<gradient
android:angle="90"
android:endColor="#000000"
android:startColor="#000000" />
<!-- 实心 -->
<solid android:color="#ffffff" />
<!--
corners:圆角
android:radius为角的弧度,值越大角越圆。
<corners
android:radius="2dp" />
我们还可以把四个角设定成不同的角度,方法为:
<corners
android:topRightRadius="20dp" 右上角
android:bottomLeftRadius="20dp" 右下角
android:topLeftRadius="1dp" 左上角
android:bottomRightRadius="0dp" 左下角
/>
还有网上看到有人说设置成0dp无效,不过我在测试中发现是可以的,我用的是2.2,可能修复了这个问题吧,如果无效的话那就只能设成1dp了。
-->
<corners
android:bottomLeftRadius="15px"
android:bottomRightRadius="15px"
android:topLeftRadius="15px"
android:topRightRadius="15px" />
<!-- 描边 -->
<stroke
android:width="2dp"
android:color="#dcdcdc" />
<!--
stroke:描边
android:width="2dp" 描边的宽度,android:color 描边的颜色。
我们还可以把描边弄成虚线的形式,设置方式为:
android:dashWidth="5dp"
android:dashGap="3dp"
其中android:dashWidth表示'-'这样一个横线的宽度,android:dashGap表示之间隔开的距离。
-->
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!--
gradient渐变
angle是渐变角度,必须为45的整数倍 -->
<gradient
android:angle="90"
android:endColor="#000000"
android:startColor="#000000" />
<!-- 实心 -->
<solid android:color="#ffffff" />
<!--
corners:圆角
android:radius为角的弧度,值越大角越圆。
<corners
android:radius="2dp" />
我们还可以把四个角设定成不同的角度,方法为:
<corners
android:topRightRadius="20dp" 右上角
android:bottomLeftRadius="20dp" 右下角
android:topLeftRadius="1dp" 左上角
android:bottomRightRadius="0dp" 左下角
/>
还有网上看到有人说设置成0dp无效,不过我在测试中发现是可以的,我用的是2.2,可能修复了这个问题吧,如果无效的话那就只能设成1dp了。
-->
<corners
android:bottomLeftRadius="15px"
android:bottomRightRadius="15px"
android:topLeftRadius="15px"
android:topRightRadius="15px" />
<!-- 描边 -->
<stroke
android:width="2dp"
android:color="#dcdcdc" />
<!--
stroke:描边
android:width="2dp" 描边的宽度,android:color 描边的颜色。
我们还可以把描边弄成虚线的形式,设置方式为:
android:dashWidth="5dp"
android:dashGap="3dp"
其中android:dashWidth表示'-'这样一个横线的宽度,android:dashGap表示之间隔开的距离。
-->
</shape>
0 0
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- Android中shape的使用
- ANDROID中SHAPE的使用
- Android中shape的使用
- ReSharper+StyleCop 问题汇总
- linux 系统错误表 和对应的数值
- 黑马程序员——线程通信
- 第10周项目1 程序填充与阅读
- 第十周项目0-求最大公约数
- android中shape的使用
- 分别用PopupWindow和AlertDialog实现对话框实例
- 数据结构:线性表之单链表
- 【LeetCode】3Sum Closest 解题报告
- 利用x264lib编码h264流的源码
- HDOJ 题目3466 Proud Merchants(需排序的01背包)
- 1068: 找零钱
- addSubview和insertSubview 区别
- codevs 1482 路线统计