Android Shape 的使用
来源:互联网 发布:淘宝首页海报是指什么 编辑:程序博客网 时间:2024/06/01 07:19
Shape的使用
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <!-- 边框 --> <stroke android:width="2dp" android:color="#FFFFFF" /> <!-- 圆角 --> <corners android:radius="8dp" /> <!--填充--> <solid android:color="#00000000" /></shape>
android:shape
它可选的值如下:
rectangle //矩形
oval //椭圆
line //线
ring //圆环
自属性是包含在shape内部的一些属性,主要包括:
corners //圆角
gradient//渐变
padding //内边距
size //大小
solid //填充
stroke //边框
<corners android:radius="dimension" //圆角,比如8dp、5dp等等 android:topLeftRadius="dimension" //左上圆角,比如8dp、5dp等等 android:topRightRadius="dimension" //右上圆角,比如8dp、5dp等等 android:bottomLeftRadius="dimension" //左下圆角,比如8dp、5dp等等 android:bottomRightRadius="dimension" />//左下圆角,比如8dp、5dp等等
<gradient android:angle="integer" //渐变角度,默认为0,即从左向右,90为从下向上。值必须是45的倍数 android:centerX="float" //渐变中心X,相对位置与整个shape的X的相对位置,取值范围0.0~1.0 android:centerY="float" //同X android:centerColor="color" //介于end和start之间的颜色 android:endColor="color" //结束颜色 android:gradientRadius="integer" //渐变半径,只有当type="radial"时生效 android:startColor="color" //开始颜色 android:type="linear" //渐变模式,可选的值有:linear线型,radial放射型,sweep范围型(这个真不知道怎么翻译) android:useLevel="boolean" /> //使用级别,默认为false,当用于levelListDrawable时设为true。
<padding android:left="dimension" //左 android:top="dimension" //上 android:right="dimension" //左 android:bottom="dimension" /> //下<size android:width="dimension" //宽<solid android:color="color" /> //填充颜色 <stroke android:width="dimension" //边框宽 android:color="color" //边框颜色 android:dashWidth="dimension" //虚线宽度,只有当设置了dashGap时有效 android:dashGap="dimension" /> //虚线间距,只有当设置了dashWidth时有效
阅读全文
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的使用
- mongodb
- zTree简单使用和代码结构
- [机器学习]week3编程作业:Logistic Regression
- 离散题目7
- HDOJ 1024 Max Sum Plus Plus
- Android Shape 的使用
- 详解Java中的XML解析
- Android相机基础介绍
- 面试感悟
- UI自动测试中遇到
- 安卓 身份证键盘 输入限制
- HDU1176(二维动态规划)
- Activity的详解
- java基础--if和switch的区别