shape标签总结
2016-04-23 14:46
495 查看
android开发中经常用到shape,有些标签总是忘记,所以今天就写下来。
shape标签的总结:
1.solid:里面只有一个属性,color属性。所以solid是作用就是对设置shape的控件的颜色背景。
2.gradient:这个标签用的不多,但是也有用的时候。
gradient属性有:
android:startColor=""
android:centerColor=""
android:endColor=""
android:useLevel=""
android:angle=""
android:type=""
android:centerX=""
android:centerY=""
android:gradientRadius=""
其中android:startColor是指渐变刚开始显示的颜色,
android:centerColor是渐变中间颜色,
android:endColor是渐变结束时的颜色,
android:useLevel的值只有boolean值,true和false,就是是否使用LevelListDrawable中的Drawable资源,如果是true就是使用Drawable资源,如果false就不使用drawable资源。
android:angle是渐变的方向,常用的值有0,90,180,270.其中0和180方向相反,0是从左向右,180则是从右向左;而270和90也是方向相反的,270是从上向下;
android:type是渐变的类型,有线性渐变(linear),放射性渐变(radial),扫描渐变(sweep);
android:centerX和android:centerY都是渐变中心的坐标,其中x是渐变中心的x坐标,y是渐变中心的y坐标。
android:gradientRadius直接翻译过来的意思是“渐变半径”,也确实是渐变半径,不过是要在渐变有半径时才能使用,也就是渐变类型是放射性渐变时才能使用,否则不行。
3.stroke是设置设置shape的控件的边标签,的其中的属性有:
android:width=""
android:color=""
android:dashWidth=""
android:dashGap=""其中android:width是指边的宽度,android:color颜色;android:dashWidth是设置边的线为虚线时一个虚线的宽度(左右宽度),android:dashWidth是指虚线与虚线之间的间隔。
4.corners是设置控件四个角的半径的,它的属性有:
android:bottomLeftRadius=""
android:bottomRightRadius=""
android:radius=""
android:topLeftRadius=""
android:topRightRadius=""
见名知意不做多介绍。
5.padding:是设置内容据边框的距离:
其中的属性有:
android:bottom=""
android:left=""
android:right=""
android:top=""
见名知意不做多介绍。
shape标签的总结:
1.solid:里面只有一个属性,color属性。所以solid是作用就是对设置shape的控件的颜色背景。
2.gradient:这个标签用的不多,但是也有用的时候。
gradient属性有:
android:startColor=""
android:centerColor=""
android:endColor=""
android:useLevel=""
android:angle=""
android:type=""
android:centerX=""
android:centerY=""
android:gradientRadius=""
其中android:startColor是指渐变刚开始显示的颜色,
android:centerColor是渐变中间颜色,
android:endColor是渐变结束时的颜色,
android:useLevel的值只有boolean值,true和false,就是是否使用LevelListDrawable中的Drawable资源,如果是true就是使用Drawable资源,如果false就不使用drawable资源。
android:angle是渐变的方向,常用的值有0,90,180,270.其中0和180方向相反,0是从左向右,180则是从右向左;而270和90也是方向相反的,270是从上向下;
android:type是渐变的类型,有线性渐变(linear),放射性渐变(radial),扫描渐变(sweep);
android:centerX和android:centerY都是渐变中心的坐标,其中x是渐变中心的x坐标,y是渐变中心的y坐标。
android:gradientRadius直接翻译过来的意思是“渐变半径”,也确实是渐变半径,不过是要在渐变有半径时才能使用,也就是渐变类型是放射性渐变时才能使用,否则不行。
3.stroke是设置设置shape的控件的边标签,的其中的属性有:
android:width=""
android:color=""
android:dashWidth=""
android:dashGap=""其中android:width是指边的宽度,android:color颜色;android:dashWidth是设置边的线为虚线时一个虚线的宽度(左右宽度),android:dashWidth是指虚线与虚线之间的间隔。
4.corners是设置控件四个角的半径的,它的属性有:
android:bottomLeftRadius=""
android:bottomRightRadius=""
android:radius=""
android:topLeftRadius=""
android:topRightRadius=""
见名知意不做多介绍。
5.padding:是设置内容据边框的距离:
其中的属性有:
android:bottom=""
android:left=""
android:right=""
android:top=""
见名知意不做多介绍。
相关文章推荐
- 简易通讯录
- windows上安装RabbitMQ
- PHP加速器eaccelerator导致php-fpm进程卡死原因分析
- Exercise(5):最大子矩阵
- Linux字符设备注册与注销
- 正则
- 216. Combination Sum III
- 209. Minimum Size Subarray Sum
- java jsp实现网站访问量的统计
- SAR成像基础知识急救箱(零)关于傅里叶变换的几个小困惑
- Android源码分析之——下载并编译源码
- 写出ELGamal公钥密码算法的加密、解密过程
- Docker基础技术:DeviceMapper
- Android之Viewpager+Fragment实现懒加载
- HDU 5670 Machine
- 数据结构—约瑟夫问题
- window server2012 + IIS8.0 + tomcat 集成环境搭建
- ThreadLocal详解
- 1006
- MMORPG游戏设计