关于Android Drawable Resource
2016-03-17 23:13
441 查看
如题,主要涉及Shape和Selector等, 纯粹当字典使用。
现在这个阶段的内容都来源于网上其他博主的劳动成果,等有空了会考虑自己收集整理。//TODO
1.Shape
<shape> Android:shape=["rectangle" | "oval" | "line" | "ring"]
其中rectagle矩形,oval椭圆,line水平直线,ring环形
<shape>中子节点的常用属性:
<gradient> 渐变
Android:startColor
起始颜色
Android:endColor
结束颜色
Android:angle
渐变角度,0从左到右,90表示从下到上,数值为45的整数倍,默认为0;
Android:type
渐变的样式 liner线性渐变 radial环形渐变 sweep
<solid > 填充
Android:color
填充的颜色
<stroke >描边
Android:width
描边的宽度
Android:color
描边的颜色
Android:dashWidth
表示'-'横线的宽度
Android:dashGap
表示'-'横线之间的距离
<corners >圆角
Android:radius
圆角的半径 值越大角越圆
Android:topRightRadius
右上圆角半径
Android:bottomLeftRadius
右下圆角角半径
Android:topLeftRadius
左上圆角半径
Android:bottomRightRadius
左下圆角半径
<padding >填充
android:bottom="1.0dip"
底部填充
android:left="1.0dip"
左边填充
android:right="1.0dip"
右边填充
android:top="0.0dip"
上面填充
2.Selector
android:state_selected 是选中
android:state_focused 是获得焦点
android:state_pressed 是点击
android:state_enabled 是设置是否响应事件,指所有事件
另:
android:state_window_focused 默认时的背景图片
现在这个阶段的内容都来源于网上其他博主的劳动成果,等有空了会考虑自己收集整理。//TODO
1.Shape
<shape> Android:shape=["rectangle" | "oval" | "line" | "ring"]
其中rectagle矩形,oval椭圆,line水平直线,ring环形
<shape>中子节点的常用属性:
<gradient> 渐变
Android:startColor
起始颜色
Android:endColor
结束颜色
Android:angle
渐变角度,0从左到右,90表示从下到上,数值为45的整数倍,默认为0;
Android:type
渐变的样式 liner线性渐变 radial环形渐变 sweep
<solid > 填充
Android:color
填充的颜色
<stroke >描边
Android:width
描边的宽度
Android:color
描边的颜色
Android:dashWidth
表示'-'横线的宽度
Android:dashGap
表示'-'横线之间的距离
<corners >圆角
Android:radius
圆角的半径 值越大角越圆
Android:topRightRadius
右上圆角半径
Android:bottomLeftRadius
右下圆角角半径
Android:topLeftRadius
左上圆角半径
Android:bottomRightRadius
左下圆角半径
<padding >填充
android:bottom="1.0dip"
底部填充
android:left="1.0dip"
左边填充
android:right="1.0dip"
右边填充
android:top="0.0dip"
上面填充
2.Selector
android:state_selected 是选中
android:state_focused 是获得焦点
android:state_pressed 是点击
android:state_enabled 是设置是否响应事件,指所有事件
另:
android:state_window_focused 默认时的背景图片
相关文章推荐
- 谷歌正式发布基于X86的Android L模拟器
- Android自制图片的三级缓存(代码+讲解)
- Android图片缩放
- 一个三年Android开发的总结-git基础知识与协作开发
- Android:RecyclerView嵌套CardView应用
- 在Eclipse中关联Android Private Libraries中文件的源代码
- android TextView实现滚动显示效果
- 源码解析Android onmeasure()的量算过程
- Android入门教程 Fragment使用教程【实例讲解】
- Android Studio中提示:Project SDK is not defined
- #Android学习#Animation简单使用
- Android开发最佳实践
- Android Studio adb无法启动解决方案
- Android Service的绑定简介
- Android RecyclerView 使用完全解析 体验艺术般的控件
- Toolbar完整封装
- 初入android之CheckBox
- Android 进程常驻(5)----开机广播的简单守护以及总结
- Android 内核 - 03 创建应用窗口 和 子窗口
- Throwable:Invalid stub element type in index