android Shape使用
来源:互联网 发布:js 获取iframe 对象 编辑:程序博客网 时间:2024/05/20 16:14
android shape的使用
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <!-- 圆角 --> <corners android:radius="9dp" android:topLeftRadius="2dp" android:topRightRadius="2dp" android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp"/><!-- 设置圆角半径 --> <!-- 渐变 --> <gradient android:startColor="@android:color/white" android:centerColor="@android:color/black" android:endColor="@android:color/black" android:useLevel="true" android:angle="45" android:type="radial" android:centerX="0" android:centerY="0" android:gradientRadius="90"/> <!-- 间隔 --> <padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp"/><!-- 各方向的间隔 --> <!-- 大小 --> <size android:width="50dp" android:height="50dp"/><!-- 宽度和高度 --> <!-- 填充 --> <solid android:color="@android:color/white"/><!-- 填充的颜色 --> <!-- 描边 --> <stroke android:width="2dp" android:color="@android:color/black" android:dashWidth="1dp" android:dashGap="2dp"/></shape>
填充:设置填充的颜色
间隔:设置四个方向上的间隔
大小:设置大小
圆角:同时设置五个属性,则Radius属性无效
android:Radius=”20dp” 设置四个角的半径
android:topLeftRadius=”20dp” 设置左上角的半径
android:topRightRadius=”20dp” 设置右上角的半径
android:bottomLeftRadius=”20dp” 设置右下角的半径
android:bottomRightRadius=”20dp” 设置左下角的半径
描边:dashWidth和dashGap属性,只要其中一个设置为0dp,则边框为实现边框
android:width=”20dp” 设置边边的宽度
android:color=”@android:color/black” 设置边边的颜色
android:dashWidth=”2dp” 设置虚线的宽度
android:dashGap=”20dp” 设置虚线的间隔宽度
渐变:当设置填充颜色后,无渐变效果。angle的值必须是45的倍数(包括0),仅在type=”linear”有效,不然会报错。android:useLevel 这个属性不知道有什么用。
angle对应值的起点如图:
我是黑体字
我是微软雅黑
我是华文彩云
color=#0099ff size=3 face=”黑体”
color=#00ffff size=4
color=gray size=5
- 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的使用
- ACM常用C++模板 包括常用头文件
- iOS 使用UICountingLabel实现数字变化的动画效果
- dispatchDraw
- Nginx Tomcat
- 我的故事和租房子的故事
- android Shape使用
- HDU6092-Rikka with Subset
- win7系统IE11浏览器导致页面无法点选日期解决方法:
- 网易编程:魔力手环
- ubuntu12.04下Python 3.5.3 +OpenCV 3.2.0编译环境搭建
- java中Map,List与Set的区别
- MP4文件格式的解析,以及MP4文件的分割算法
- 程序员职业生涯全攻略
- HDU 5692 Snacks 【DFS序+线段树】