shape的使用
来源:互联网 发布:mac版yy进频道失败 编辑:程序博客网 时间:2024/06/05 00:42
<span style="font-family:SimHei;font-size:24px;color:#FF6666;"><shape>定义这是一个GradientDrawable,必须作为根元素。</span><span style="font-size:18px;">shape中全部的属性如下:代码不可以直接用.</span>
<span style="font-size:12px;"> <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=["rectangle" | "oval" | "line" | "ring"] > //四种模式,不同模式下可以使用的节点不一样. <corners //(角)此节点只有模式为"rectangle"时候才可以使用 android:radius="integer" //圆角的半径。会被下面每个特定的圆角属性重写。 android:topLeftRadius="integer" //top-left 设置左上角的半径 android:topRightRadius="integer" //top-right 设置右上角的半径 android:bottomLeftRadius="integer" //设置左下角的半径 android:bottomRightRadius="integer" /> //设置右下角的半径 <gradient //此节点指定这个shape的渐变颜色 android:angle="integer" //渐变的角度。 0 代表从 left 到 right。90 代表bottom到 top。必须是45的倍数,默认为0 android:centerX="Float" //渐变中心的相对X坐标,在0到1.0之间。 android:centerY="Float" android:startColor="color" //Color。可选的颜色值,开始的颜色 android:centerColor="color" //Color。可选的颜色值。基于startColor和endColor之间。 android:endColor="color" //Color。可选的颜色值,结束的颜色 android:gradientRadius="integer" //整型 渐变色半径.当 android:type="radial" 时才使用。单独使用 android:type="radial"会报错。 android:type=["linear" | "radial" | "sweep"] //渐变的模式</span><span style="font-size:12px;"></span><pre name="code" class="html"><span style="font-size:12px;"> "linear" 线形渐变。这也是默认的模式 "radial" 辐射渐变。startColor即辐射中心的颜色 "sweep" 扫描线渐变。</span><span style="font-size:12px;">android:useLevel=["true" | "false"] /> //Boolean。如果在LevelListDrawable中使用,则为true <padding //内容与视图边界的距离 android:left="integer" //左边填充距离. android:top="integer" //上边填充距离. android:right="integer" //右边填充距离. android:bottom="integer" /> //</span><span style="font-size:12px;">底边边填充距离. <size //这个shape的大小。 android:width="integer" //这个shape的高度。 android:height="integer" /> //这个shape的宽度。//注意:默认情况下,这个shape会缩放到与他所在容器大小成正比。当你在一个ImageView中使用这个shape,你可以使用 android:scaleType="center"来限制这种缩放,。 <solid //填充这个shape的纯色 android:color="color" /> //Color。颜色值,十六进制数,或者一个Color资源<span style="font-size:12px;"> <stroke //区域描边,设置区域的边框。全部模式可以用的,当android:shape="line"的时候,则必须设置此元素, android:width="integer" //笔画的粗细。 android:color="color" //Color。笔画的颜色 android:dashWidth="integer" //每画一条线的长度。只有当 android:dashGap也设置了才有效。 android:dashGap="integer" /> //每画一条线就间隔多少。只有当android:dashWidth也设置了才有效。 </shape> </span></span>
android:shape="ring" (环形状)的时候额外下面几个属性可以设置:</span>
android:innerRadius="" 尺寸。 内环的半径。一个尺寸值(dip等等)或者一个尺寸资源。 android:innerRadius="" Float类型。这个值表示内部环的比例,例如,如果android:innerRadiusRatio = " 5 ",那么内部的半径等于环的宽度除以5。这个值会被android:innerRadius重写。 默认值是9。 android:thickness="" 尺寸。环的厚度,是一个尺寸值(dip等等)或尺寸的资源。 android:thicknessRatio="" Float类型。厚度的比例。例如,如果android:thicknessRatio= " 2 ",然后厚度等于环的宽度除以2。这个值是被android:innerRadius重写, 默认值是3。 android:useLevel="" Boolean类型。如果用在 LevelListDrawable里,那么就是true。如果通常不出现则为false。</span>
0 0
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- <shape>的使用
- android shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- android:shape的使用
- #2016多校训练Contest10: 1002 Hard problem hdu5858
- ImageMagick使用小节
- ServletContext简介
- 求助,九度1020
- 索引的选择原则
- shape的使用
- 数据结构实验之排序四:寻找大富翁
- 自定义接口进行传值
- python - 文件下载
- 最近在ubunto下搞android遇到的一些坑,持续更新
- C#WinForm上传文件的方案
- servletcontext读取web资源文件
- Unity打包到Android错误解决
- 易犯的错误(实时更新)