android:dataPath解析
来源:互联网 发布:政府集中采购流程 知乎 编辑:程序博客网 时间:2024/05/29 12:52
位于res/drawable/face.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="200dp" android:width="200dp" android:viewportHeight="100" android:viewportWidth="100" > <path android:strokeColor="@android:color/holo_red_dark" android:fillColor="@color/yellow" android:pathData="@string/path_circle"/> <path android:fillColor="@android:color/black" android:pathData="@string/path_face_left_eye"/> <path android:fillColor="@android:color/black" android:pathData="@string/path_face_right_eye"/> <path android:name="mouth" android:strokeColor="@android:color/black" android:strokeWidth="@integer/stroke_width" android:strokeLineCap="round" android:pathData="@string/path_face_mouth_sad"/></vector>
res/values/strings.xml
<string name="path_circle"> M 50,50 m -48,0 a 48,48 0 1,0 96,0 a 48,48 0 1,0 -96,0 </string> <string name="path_face_left_eye"> M 35,40 m -7,0 a 7,7 0 1,0 14,0 a 7,7 0 1,0 -14,0 </string> <string name="path_face_right_eye"> M 65,40 m -7,0 a 7,7 0 1,0 14,0 a 7,7 0 1,0 -14,0 </string> <string name="path_face_mouth_sad"> M 30,75 Q 50,55 70,75 </string> <string name="path_face_mouth_happy"> M 30,65 Q 50,85 70,65 </string>
参考文章:http://www.w3.org/TR/SVG/paths.html#PathDataM是移动的意思,大写代表绝对坐标,小写是相对坐标,注意相对的对象是其前一个对象。a是画弧,48,48分别是所画弧的x,y轴的半径,0是x轴偏移量,1是取大弧,0是逆时针,(96,0)是终点坐标。
下面的a同理。 <span style="font-family: Arial, Helvetica, sans-serif;">若将48全换成24,96全换成48,会看到圆的半径为原来的一半。 </span><span style="font-family: Arial, Helvetica, sans-serif;"> </span>
0 0
- android:dataPath解析
- open vswitch研究:datapath
- open vswitch研究:datapath
- openvswitch、Bridge、Datapath
- OVS中的datapath学习
- Open vSwitch Datapath浅析
- Dataset, datapath, datapointer in Laszlo
- Open vSwitch datapath developer documentation
- Openvswitch、Bridge、Datapath简单介绍
- OVS datapath模块分析:基本架构
- OVS datapath模块分析:packet处理流程
- OVS datapath模块分析:packet处理流程
- OVS源码研究 Datapath进行Packet处理
- 【OVS2.5.0源码分析】datapath之netlink
- dump struct sw_flow from vport/datapath
- OVS vport, datapath, flow_table, flex_array, sw_flow
- Android - Android项目解析
- Android-Android解析JSON
- hibernate的抓取策略
- 【C语言】用可变参数列表实现printf函数
- 拦截器拦截 ajax代码,以及乱码处理
- HDU 2514--Another Eight Puzzle【DFS】
- Maven仓库管理-Nexus
- android:dataPath解析
- Mark
- Mark
- JavaScript的事件代理(赞)
- 求两日期之间的相隔天数(year,month,day)
- Zipper记忆化搜索
- Algorithm Gossip: 奇数魔方阵
- iOS 图片存到沙盒
- poj 3274 Gold Balanced Lineup