XML Drawable
来源:互联网 发布:redis队列php 编辑:程序博客网 时间:2024/05/18 03:57
android把任何可绘制在屏幕上的图形图像都称为drawable.
XML drawable与像素密度无关,将其放入drawable目录即可。
一、shape drawable
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="3dp"/> <gradient android:angle="270" android:endColor="#cccccc" android:startColor="#acacac"/></shape>二、state list drawable
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@drawable/button_shape_normal" android:state_pressed="false"/> <item android:drawable="@drawable/button_shape_pressed" android:state_pressed="true"/></selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:color="#ffffff" android:state_pressed="false"/> <item android:color="#556699" android:state_pressed="true"/></selector>三、layer list 与 inset drawable
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <corners android:radius="5dp"/> <gradient android:angle="90" android:centerColor="#303339" android:centerY="0.05" android:endColor="#000000" android:startColor="#000000"/> </shape> </item> <item> <inset android:drawable="@drawable/button_shape" android:insetBottom="5dp"/> </item></layer-list>效果:出现阴影
0 0
- XML Drawable
- Android Drawable ---Bitmap xml
- Android -- XML Drawable
- Drawable 新建xml
- Drawable Xml样式
- Android中的XML drawable
- android drawable-xml
- Android 获取XML,DRAWABLE资源
- Shape Drawable Xml的background
- drawable目录下的xml
- android开发 drawable中XML
- XML Drawable 与9-Patches
- Android drawable in xml study
- Drawable.xml中的属性详解
- Vertical line using XML drawable
- NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource
- File res/drawable/abc_vector_test.xml from drawable resource ID
- File res/drawable/abc_vector_test.xml from drawable resource ID
- javascript组件开发方式
- oracle导入导出数据的几种方式
- CCF-201604-3 路径解析(模拟)
- HttpServletRequest对象
- iOS 开发中的争议(二)--唐巧
- XML Drawable
- 资源的快速下载技巧
- dexClassLoader 学习
- BSON
- UISearchBar控件介绍
- testlink导入excel神器!(原版里面代码有问题,我自己改了,很好用,不会调试代码的再问我要)
- 以SpringMVC框架为中心疯狂扩展-13、quartz持久化
- (16)HTML5-E-Mail和时间日期
- [美剧赏析] 权力的游戏<Game of Thrones>完全赏析 (49-50)