android:dataPath解析

位于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#PathData

M是移动的意思,大写代表绝对坐标,小写是相对坐标,注意相对的对象是其前一个对象。
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>

unity 5.3配置文件<?xml version="1.0" encoding="utf-8" standalone="no"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.dw.Dating.lua" platformBuildVersionCode="25" platformBuildVersionName="7.1.1"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/> <uses-feature android:glEsVersion="0x20000"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-feature android:name="android.hardware.touchscreen" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.READ_LOGS"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.webkit.permission.PLUGIN"/> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/> <uses-permission android:name="android.permission.VIBRATE"/> <meta-data android:name="android.support.VERSION" android:value="25.3.1"/> <application android:hardwareAccelerated="false" android:icon="@drawable/app_icon" android:isGame="true" android:label="@string/app_name" android:name="com.dw.Dating.wxapi.App"> <meta-data android:name="URL_VALUE" android:value="http://192.168.2.169"/> <meta-data android:name="CHANNEL" android:value="AgentID-0"/> <meta-data android:name="FW_VALUE" android:value="FW-30855784"/> <meta-data android:name="AppID" android:value="wx401c37330dd3e92e"/> <activity android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.dw.Dating.wxapi.MainActivity" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LEANBACK_LAUNCHER"/> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true"/> <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false"/> </activity> <activity android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTask" android:name="com.fanwei.jubaosdk.cashier.CashierActivity" android:theme="@style/FanweiDialogActivityTheme"/> <activity android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" android:name="com.fanwei.jubaosdk.wap.WapActivity" android:screenOrientation="portrait" android:theme="@style/FanweiActivityTheme"/> <provider android:authorities="com.dw.Dating.lua.fileProvider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths_fanwei"/> </provider> <activity android:name="com.pay.sdk.usage.PayActivity" android:screenOrientation="portrait"/> <activity android:name="sdk.pay.PayWebViewActivity" android:screenOrientation="portrait"/> <activity android:name="com.switfpass.pay.activity.QQWapPayWebView" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <activity android:exported="true" android:launchMode="singleTop" android:name="com.dw.Dating.lua.wxapi.WXEntryActivity" android:theme="@android:style/Theme.NoDisplay"/> <meta-data android:name="UMENG_APPKEY" android:value="111"/> <meta-data android:name="UMENG_CHANNEL" android:value="Test"/> </application> </manifest> 帮我修正错误
最新发布
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值