android xml绘图p113-p117
1.Bitmap
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@mipmap/ic_launcher"> </bitmap>
2.shape
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"><!--shape有rectangle(矩形)、oval(椭圆)、line(直线)、ring(环)--> <!--corners在shape为rectangle的时候使用,默认为1dp-->
<corners
android:bottomLeftRadius="1dp"
android:bottomRightRadius="1dp"
android:radius="1dp"
android:topLeftRadius="1dp"
android:topRightRadius="1dp" /> <!--gradient渐变-->
<gradient
android:angle="integer"
android:centerColor="color"
android:centerX="integer"
android:centerY="integer"
android:endColor="color"
android:gradientRadius="integer"
android:startColor="color"
android:type="linear/radial/sweep"
android:useLevel="boolean" /> <padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" /> <!--size指定大小,一般用在imageView配合scaleType属性使用-->
<size android:width="integer"
android:height="integer"/> <!--solid填充颜色-->
<solid android:color="color"/> <!--stroke指定边框 dashWidth:虚线宽度 dashGap:虚线间隔宽度 -->
<stroke android:color="color"
android:width="integer"
android:dashWidth="integer"
android:dashGap="integer" /> </shape>
3.layer 图层叠加
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@mipmap/ic_launcher" /> <item
android:bottom="10dp"
android:drawable="@mipmap/ic_launcher"
android:left="10dp"
android:right="10dp"
android:top="10dp" /> </layer-list>
4.Selector
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <!--默认时的背景图片-->
<item android:drawable="@mipmap/ic_launcher" /> <!--没有焦点时的背景图片-->
<item android:drawable="@mipmap/ic_launcher" android:state_window_focused="false" /> <!--非触摸模式下点击时的背景图片-->
<item android:drawable="@mipmap/ic_launcher" android:state_focused="true" android:state_pressed="true" /> <!--触摸模式下单击时的背景图片-->
<item android:drawable="@mipmap/ic_launcher" android:state_focused="false" android:state_pressed="true" /> <!--选中时的背景图片-->
<item android:drawable="@mipmap/ic_launcher" android:state_selected="true" /> <!--获取焦点时的背景图片-->
< item android:drawable="@mipmap/ic_launcher" android:state_focused="true" />
</selector>
通常情况下都是可以组合使用的
android xml绘图p113-p117的更多相关文章
- Drawable实战解析:Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)
Android XML shape 标签使用详解 一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...
- Android xml 格式 随笔
打包的时候Android xml文件会由字符格式(utf-8编码)转换为二进制格式.具体如:http://blog.csdn.net/jiangwei0910410003/article/detail ...
- android XMl 解析神奇xstream 六: 把集合list 转化为 XML文档
前言:对xstream不理解的请看: android XMl 解析神奇xstream 一: 解析android项目中 asset 文件夹 下的 aa.xml 文件 android XMl 解析神奇xs ...
- android XMl 解析神奇xstream 五: 把复杂对象转换成 xml ,并写入SD卡中的xml文件
前言:对xstream不理解的请看: android XMl 解析神奇xstream 一: 解析android项目中 asset 文件夹 下的 aa.xml 文件 android XMl 解析神奇xs ...
- android XMl 解析神奇xstream 四: 将复杂的xml文件解析为对象
前言:对xstream不理解的请看: android XMl 解析神奇xstream 一: 解析android项目中 asset 文件夹 下的 aa.xml 文件 android XMl 解析神奇xs ...
- android XMl 解析神奇xstream 三: 把复杂对象转换成 xml
前言:对xstream不理解的请看: android XMl 解析神奇xstream 一: 解析android项目中 asset 文件夹 下的 aa.xml 文件 android XMl 解析神奇xs ...
- android XMl 解析神奇xstream 二: 把对象转换成xml
前言:对xstream不理解的请看:android XMl 解析神奇xstream 一: 解析android项目中 asset 文件夹 下的 aa.xml 文件 1.Javabeen 代码 packa ...
- 【转】Android Canvas绘图详解(图文)
转自:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2012/1212/703.html Android Canvas绘图详解(图文) 泡 ...
- Android SurfaceView 绘图覆盖刷新及脏矩形刷新方法
http://www.cnblogs.com/SkyD/archive/2010/11/08/1871423.html Android SurfaceView 绘图覆盖刷新及脏矩形刷新方法 Surfa ...
随机推荐
- Unity3d 面向对象设计思想(六)(Unity3d网络异步数据)
在MonoBehavior类中有一个方法是StartCoroutine.里面要求的是一个接口为IEnumerator协同的返回值, 在Unity3d中,协同的作用是马上返回结果的.而不影响其它程序的运 ...
- springMvc获取特殊值
1.获取数组
- 在Web上运行Linux—js/linux模拟器
一个叫Fabrice Bellard 的程序员写了一段Javascript在Web浏览器中启动Linux(原网页,我把这个网页iframe在了下面),目前,你只能使用Firefox 4和Chrome ...
- php 获取各类时间归类
//php获取今日开始时间戳和结束时间戳 $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y')); $endToday=mktime(0,0,0 ...
- Django-进阶之路--信号
Model 到目前为止,当我们的程序涉及到数据库相关操作时,我们一般都会这么搞: 创建数据库,设计表结构和字段 使用 MySQLdb 来连接数据库,并编写数据访问层代码 业务逻辑层去调用数据访问层执行 ...
- save a web page as a single file (mht format) using Delphi code
Here's how to save a web page as a single file (mht format) using Delphi code: uses CDO_TLB, ADODB_T ...
- 5. Longest Palindromic Substring(最长回文子串 manacher 算法/ DP动态规划)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum lengt ...
- 199. Binary Tree Right Side View -----层序遍历
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nod ...
- java GC 回收机制 转
JVM分代垃圾回收策略的基础概念 由于不同对象的生命周期不一样,因此在JVM的垃圾回收策略中有分代这一策略.本文介绍了分代策略的目标,如何分代,以及垃圾回收的触发因素. 文章总结了JVM垃圾回收策略为 ...
- Firebug入门指南(转)
本文转自:http://www.ruanyifeng.com/blog/2008/06/firebug_tutorial.html 作者: 阮一峰 日期: 2008年6月 8日 据说,对于网页开发人员 ...