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 ...
随机推荐
- leetcode994
public class Solution { ; ; ; ; ; Queue<int[]> Q = new Queue<int[]>(); int[,] TagGrid; p ...
- [转]使用STM32CubeMX:USB大容量存储设备
原文地址http://qiita.com/mt08/items/fcc925fa47726bfc6c74 概要 STM32CubeMXを使って.USB MassStorageを使ってみる. USBを使 ...
- Appium环境安装
Appium 是开源的.跨平台的.多语言支持的 移动应用 自动化工具 原生app,如计算器 混合(Hybrid)app 内嵌web + 原生 移动 web app 手机浏览器打开的网址 安装appiu ...
- python 阿狸的进阶之路(4)
装饰器 #1.开放封闭原则:对扩展开放,对修改是封闭#2.装饰器:装饰它人的,器指的是任意可调用对象,现在的场景装饰器->函数,被装饰的对象也是->函数#原则:1.不修改被装饰对象的源代码 ...
- css3 - 特性
伪类选择器 伪类选择器,不用再使用js来控制奇偶不同了 tr:nth-child(even){ background-color: white; } tr:nth-child(odd){ backgr ...
- for循环实例2
九九乘法表: //九九乘法表 ; x < ; x++) { ; y <=x;y++ ) { Console.Write(y.ToString()+"*"+x.ToStr ...
- NAT与FULL NAT的区别
LVS 当前应用主要采用 DR 和 NAT 模式,但这 2 种模式要求 RealServer 和 LVS在同一个 vlan中,导致部署成本过高:TUNNEL 模式虽然可以跨 vlan,但RealSer ...
- docker仓库harbor搭建随笔
docker除了自己的registry仓库工具外,还有vmware出品的harbor,harbor集成了ui界面,用户级别认证,重要的是对镜像管理比较全面,可以删除镜像,下面是 简单的部署指南 首先: ...
- MVC之Model元数据
Contronoller激活之后,ASP.NET MVC会根据当前请求上下文得到目标Action的名称,然后解析出对应的方法并执行之. 在整个Action方法的执行过程中,Model元数据的解析是一个 ...
- Python基础学习Day3 数据类型的转换、int、str、bool、字符串的常用方法、for循环
一.数据类型的转换 常用的是:int 转str.str转int.int转bool 时 非零即为 True . # 数据类型之间转换 ***** # int <--> str str(i ...