shape
来源:互联网 发布:simulink 电气端口 编辑:程序博客网 时间:2024/06/16 17:59
参考:http://blog.csdn.net/harvic880925/article/details/41850723
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!--shape命名空间 类型--> <!--android:shape="rectangle" 表示矩形--> <!--android:shape="oval" 表示椭圆--> <!--android:shape="line" 表示线--> <!--android:shape="ring" 表示环形--> <!--android:innerRadius 尺寸,内环的半径。--> <!--android:thickness 尺寸,环的厚度--> <!--android:innerRadiusRatio 浮点型,以环的宽度比率来表示内环的半径,--> <!--例如,如果android:innerRadiusRatio,表示内环半径等于环的宽度除以5,这个值是可以被覆盖的,默认为9.--> <!--android:thicknessRatio 浮点型,以环的宽度比率来表示环的厚度,例如,如果android:thicknessRatio="2",--> <!--那么环的厚度就等于环的宽度除以2。这个值是可以被android:thickness覆盖的,默认值是3.--> <!--android:useLevel boolean值,如果当做是LevelListDrawable使用时值为true,否则为false.--> <!--shape 的子节点--> <!--corners 圆角--> <!--gradient 对应颜色渐变--> <!--padding 定义内容离边界的距离--> <!--size 大小--> <!--solid 填充--> <!--stroke 描边--> <!--corners的命名空间--> <!--同时设置五个属性,则Radius属性无效--> <!--android:radius="20dp" 圆角的半径(4个角) --> <!--android:bottomLeftRadius="8dp" 左下圆角的半径--> <!--android:bottomRightRadius="5dp" 右下圆角的半径--> <!--android:topLeftRadius="6dp" 左上圆角的半径--> <!--android:topRightRadius="5dp" 右上圆角的半径--> <corners android:bottomLeftRadius="8dp" android:bottomRightRadius="5dp" android:topLeftRadius="6dp" android:topRightRadius="5dp" /> <!--padding android:left="5dp"与padding_left属性效果相同 padding没什么用处--> <!--<padding--> <!--android:bottom="5dp"--> <!--android:left="5dp"--> <!--android:right="5dp"--> <!--android:top="5dp" />--> <size android:width="100dp" android:height="50dp" /> <!--android:color="#ff00ff" 填充的颜色(如果与渐变色一起使用,会被覆盖)--> <solid android:color="#ff00ff" /> <!--dashWidth和dashGap属性,只要其中一个设置为0dp,则边框为实现边框--> <!--android:width="2dp" 线宽--> <!--android:color="#000000" 线的颜色--> <!--android:dashGap="3dp" 虚线的长度--> <!--android:dashWidth="10dp" 虚线间隔的长度--> <stroke android:width="2dp" android:color="#000000" android:dashGap="3dp" android:dashWidth="10dp" /> <!--gradient android:type="linear"--> <!--angle属性确实只对线性渐变有效--> <!--<gradient--> <!--android:angle="45"--> <!--android:centerColor="#00ff00"--> <!--android:endColor="#0000ff"--> <!--android:startColor="#ff0000"--> <!--android:type="linear" />--> <!--centerX、centerY两个属性用于设置渐变的中心点位置,仅当渐变类型为放射渐变时有效。 默认值是0.5,有效值是0.0~1.0,超出该范围后会看不出渐变效果。--> <!--<gradient--> <!--android:centerColor="#00ff00"--> <!--android:centerX="0.5"--> <!--android:centerY="0.5"--> <!--android:endColor="#0000ff"--> <!--android:startColor="#ff0000"--> <!--android:type="sweep" />--> <!--在构造放射性渐变时,要加上android:gradientRadius属性(渐变半径),即必须指定渐变半径的大小才会起作用--> <!--<gradient--> <!--android:type="radial"--> <!--android:startColor="#ff0000"--> <!--android:centerColor="#00ff00"--> <!--android:endColor="#0000ff"--> <!--android:gradientRadius="40"/>--></shape>
在控件中使用
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hello world" android:background="@drawable/shape_rect"/>
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/shape_rect"/>
0 0
- shape
- Shape
- shape
- shape
- Shape
- shape
- shape
- shape
- shape
- shape
- shape
- shape
- Shape
- Shape
- shape
- shape
- Shape
- Shape
- jsp打印九九乘法表
- HTC手机傻瓜式安装Google Play服务
- android意图Intent
- srand((unsigned int)time(NULL))引发的思考
- 云计算环境下的大规模图数据处理技术
- shape
- div实现拖拽效果,宽度发生变化
- Tornado中的Demo Blog
- 如何在cmd命令行中查看、修改、删除与添加环境变量
- Mycat读写分离、主从切换学习
- int string之间的转换
- 基于jpa/springData ,hibernate,mybtis的分页
- android动画
- 人脸识别必读的N篇文章