shape 图形
主要属性:
<?xml version="1.0"encoding="utf-8"?>
<shape >
<corners />
<gradient />
<padding />
<size />
<solid />
<stroke />
</shape>
1、corners属性(圆角):
<corners
android:radius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="20dp"
android:bottomRightRadius="30dp"
android:bottomLeftRadius="40dp"/>
2、gradient属性(渐变色):
<gradient
android:type="radial"
android:angle="0"
android:startColor="@color/red"
android:centerColor="@color/green"
android:endColor="@color/white"
android:centerX="0.3"
android:centerY="0.5"
android:useLevel="false"
android:gradientRadius="200dp"/>
type:取值["linear" | "radial" | "sweep"]共有3中渐变类型,分别是线性渐变(默认)、放射渐变、扫描式渐变。
angle:仅对线性渐变有效,0为从左到右(逆时针旋转),必须为45的倍数,90为从下到上。
3、padding属性:
<padding
android:bottom="2dp"
android:left="3dp"
android:right="3dp"
android:top="2dp"/>
4、size属性:
<size
android:width="180dp"
android:height="100dp"/>
5、solid属性:
<solid android:color="#ff5900"/>
6、stroke属性(描边):
<stroke
android:width="5dp"
android:color="@color/red"
android:dashWidth="100dp"
android:dashGap="50dp"/>
7、shape属性:
<?xml version="1.0"encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:dither="false"
android:tint="@color/red"
android:tintMode="src_atop"
android:visible="true"
android:innerRadius="100dp"
android:innerRadiusRatio="20"
android:thickness="100dp"
android:thicknessRatio="6"
android:useLevel="false">
</shape>
shape 图形的更多相关文章
- shape图形的使用
shape图形的使用 在项目中如果用到有规律的常规的图形,在能够掌握的前提下建议使用shape图形,shape图形相对与图片来说,占用资源更小,并且使用起来不会失真. 效果图 shape图形1 < ...
- android shape图形优化Button效果
android shape可以让我们通过定义xml文件的方式创建图形,当然只能实现一些比较简单的图形(圆形,矩形,椭圆,线段),但是已经相当不错了,通过shape创建的图形作为控件的背景已经基本可以满 ...
- Android 中 shape 图形的使用
转载于:http://kofi1122.blog.51cto.com/2815761/521605 Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对shap ...
- 背水一战 Windows 10 (12) - 绘图: Shape, Path
[源码下载] 背水一战 Windows 10 (12) - 绘图: Shape, Path 作者:webabcd 介绍背水一战 Windows 10 之 绘图 Shape - 图形 Path - 路径 ...
- Netron开发快速上手(一):GraphControl,Shape,Connector和Connection
版权所有,引用请注明出处:<<http://www.cnblogs.com/dragon/p/5203663.html >> 本文所用示例下载FlowChart.zip 一个用 ...
- 绘图: Shape, Path
Shape - 图形 Path - 路径 示例1.演示“Shape”相关知识点Drawing/Shape.xaml <Page x:Class="Windows10.Drawing.S ...
- 重新想象 Windows 8 Store Apps (18) - 绘图: Shape, Path, Stroke, Brush
原文:重新想象 Windows 8 Store Apps (18) - 绘图: Shape, Path, Stroke, Brush [源码下载] 重新想象 Windows 8 Store Apps ...
- Android Drawable - Shape Drawable使用详解(附图)
TIPS shape图形 –简单介绍 shape图形 –如何画? shape图形 –参数详细解析 shape图形 –如何用? shape图形 –实际开发应用场景 shape图形简单介绍 用xml实现一 ...
- FlasActionScript3随学随机
1.跳转页面代码.下载代码(new URLRequest(下载地址)): var request1:URLRequest=new URLRequest("http://www.baidu.c ...
随机推荐
- Spring boot 定制自己的错误
1).如何定制错误的页面: 1).有模板引擎的情况下:error/状态码; [将错误页面命名为 错误状态码.html 放在模板引擎文件夹里面的 error文件夹下],发生此状态码的错误就会来到 对 ...
- Java中,&&与&,||与|的区别
在java的逻辑运算符中,有这么四类:&&(短路与),&,|,||(短路或). &&和&都是表示与,区别是&&只要第一个条件不满足,后面 ...
- vue:再vue-cli项目中使用window以及调用window上的方法
一: 1:在main.js中 Vue.prototype.myfunction = function() {/*你的自定义Vue方法*/} 2:在mounted(或其他生命周期中) 或者 method ...
- U3D开发中关于脚本方面的限制-有关IOS反射和JIT的支持问题
U3D文档中说明了,反射在IOS是支持的,除了system.reflection.emit空间内的,其它都支持.JIT是不支持的. 本质上来说即是:只要不在运行时动态生成代码的行为都支持,reflec ...
- 解析swf文件头,获取flash的原始尺寸
要想解析swf文件头,首先要弄清楚的当然是swf文件格式规范.规范中对swf文件格式作了详细的说明.关于swf文件头,它是由以下几个部分组成:+-------+---+--------+------- ...
- Haskell语言学习笔记(75)Conduit
安装 conduit $ cabal install conduit Installed conduit-1.3.0.3 Prelude> import Conduit Prelude Cond ...
- ORA-01078和LRM-00109问题导致ORACLE启动失败解决方法
操作环境 SuSE11sp3 + ORACLE11gR2(11.2.0.3) 问题现象 新安装的ORACLE启动失败,提示ORA-01078和LRM-00109错误.具体错误现象如下 SQL> ...
- IE 11中 onpropertychange失效
https://msdn.microsoft.com/zh-cn/library/ie/dn265032(v=vs.85).aspx 将突变事件和属性更改事件迁移到突变观察者 Internet Exp ...
- JavaScriptConverter
public class DatePartsConverter : JavaScriptConverter { public override IEnumerable<Type> Supp ...
- EF 踩过的坑
ef + mysql-8.0.12-winx64 这个版本的mysql,当一个类为树型结构,会迁移报错. 数据迁移提示:No connection string named 'TaoBaoEntiti ...