android:shape 属性
来源:互联网 发布:靠谱韩代 淘宝店 良心 编辑:程序博客网 时间:2024/05/01 17:51
android: shape 属性用于自定义形状:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape=["rectangle" | "oval" | "line" | "ring"] >矩形、椭圆形、线形、环形
<corners 圆角(仅适用于当其形状是矩形)
android:radius="dimension" 半径
android:topLeftRadius="dimension" 左上角半径
android:topRightRadius="dimension" 右上角半径
android:bottomLeftRadius="dimension" 左下角半径
android:bottomRightRadius="dimension" /> 右下角半径
<gradient 渐变色
android:angle="integer" 渐变角度,0从左到右,90从上到下,必须是45的倍数,默认为0
android:centerX="float" 渐变中心X轴坐标的相对位置,范围:0 — 1.0
android:centerY="float" 渐变中心Y轴坐标的相对位置,范围:0 — 1.0
android:centerColor="color" 渐变中间颜色,即开始颜色与结束颜色之间的颜色
android:endColor="color" 结束颜色
android:gradientRadius="integer" 渐变半径android:type="radial" 时才使用。单独使用android:type="radial"会报错
android:startColor="color" 起始颜色
android:type=["linear" | "radial" | "sweep"]linear:线性渐变(默认选项);radial:放射性渐变,以开始色为中心;sweep:扫描线式渐变
android:useLevel=["true" | "false"] /> 如果要使用LevelListDrawable对象,就要设置为true。设置为true无渐变色,false有渐变色
<padding 内边距
android:left="dimension" 左内边距
android:top="dimension" 上内边距
android:right="dimension" 右内边距
android:bottom="dimension" /> 下内边距
<size
android:width="dimension" 宽度
android:height="dimension" /> 高度
<solid 内部填充
android:color="color" /> 填充颜色
<stroke 描边
android:width="dimension" 描边的宽度
android:color="color" 描边的颜色
android:dashWidth="dimension" 描边的样式是虚线时的宽度,值为0时为实线,值大于0时为虚线
android:dashGap="dimension" /> 描边为虚线时,虚线之间的间隔
</shape>
下面的几个属性只有android:shape="ring时可用:
android:innerRadius (dimension) 内环的半径
android:innerRadiusRatio (float) 以环的宽度比率来表示内环的半径,eg.如果android:innerRadiusRatio="5",表示内环半径等于环的宽度除以5,这个值是可以被android:innerRadius 覆盖的,默认为9.
android:thickness (dimension) 环的厚度
android:thicknessRatio (float) 以环的宽度比率来表示环的厚度,eg.如果android:thicknessRatio="2",那么环的厚度就等于环的宽度除以2。这个值是可以被android:thickness覆盖的,默认值是3.
android:useLevel (boolean) 如果当做LevelListDrawable使用时值为true,否则为false.
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属性详解
- 如何终止java线程
- SecureCRT的几项设置
- 二叉树的遍历_C++实现
- XML
- PAT 1087. All Roads Lead to Rome (30)
- android:shape 属性
- javaweb之Filter详解
- WWDC 2012 Session笔记——202, 228, 232 AutoLayout(自动布局)入门
- 宏操作
- 【COGS】421 [SDOI2009] HH的项链 树状数组
- inux设备驱动中的并发控制
- hibernate 数据库几种连接数据
- C语言实现大小写转换的三种方法
- zoj 3809 水 2014 ACM牡丹江区域赛网赛