首页 > 解决方案 > 如何在我的 UIImageView 中使用 Android .xml 文件作为图像

问题描述

这是我的 image.xml 文件内容,我想在UIImageView使用 Objective-C 代码时将其用作图像。在 Android 上工作,但我不知道如何在 iOS 上的 Objective-C 中做到这一点。有什么想法或建议吗?

<vector android:height="200dp" android:viewportHeight="512"
    android:viewportWidth="512" android:width="200dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#000000"
        android:pathData="M239.8,56.7c-23,30.7 -38.9,74.6 -44.2,122.3 -1.8,16.4 -3.1,43.9 -2.2,47.4l0.6,2.6 54,-0 54,-0 0,-12.8c0,-64.6 -17.4,-123.2 -48.2,-162 -2.7,-3.4 -5.5,-6.2 -6.2,-6.2 -0.7,-0 -4.2,3.9 -7.8,8.7z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M462.5,78.6c-10.1,3.6 -16.8,13.3 -16.8,24.4 0,7.5 1.6,12 6.3,17.4 5.4,6.1 10.2,8.1 19.5,8.1 6.3,-0 8.9,-0.5 12.1,-2.2 5.9,-3.1 11,-9.3 12.8,-15.4 2,-6.6 2,-9.2 0,-15.8 -4,-13.5 -20.2,-21.4 -33.9,-16.5zM481.4,85.3c8.3,4.7 12.9,14.3 10.7,22.2 -1.6,5.9 -4.5,10.1 -9.2,13.2 -3.6,2.4 -5.3,2.8 -11,2.8 -5.8,-0 -7.3,-0.4 -11.1,-3 -4.6,-3.3 -9.8,-11.9 -9.8,-16.4 0,-7.6 5.4,-16.1 12.3,-19.5 4.8,-2.3 13.4,-2 18.1,0.7z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M461,103.5l0,14.5 3,-0 3,-0 0,-6c0,-4.6 0.3,-6 1.5,-6 1.8,-0 5.8,4.2 8.2,8.7 1.5,2.8 2.3,3.3 5.5,3.3 4.8,-0 4.8,-1.2 -0.2,-7.8 -2.2,-2.8 -3.5,-5.2 -3,-5.2 2.4,-0 5,-4.1 5,-7.9 0,-6.3 -3.1,-8.1 -14.1,-8.1l-8.9,-0 0,14.5z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M14.5,140.7c4.4,33.8 9.2,53.8 18.7,78l4,10.3 65.4,-0c38.8,-0 65.4,-0.4 65.4,-0.9 0,-2.4 -13.5,-18.8 -24.4,-29.7 -23.1,-23.1 -46.8,-37.5 -81,-49.3 -11.3,-3.9 -35.4,-10.2 -44.4,-11.6l-4.3,-0.7 0.6,3.9z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M473,139c-42.9,8.1 -80.8,25 -108.9,48.4 -10,8.4 -25.3,24.2 -32.3,33.6l-5.7,7.5 66.6,0.3c36.7,0.1 67,-0.1 67.4,-0.5 1.4,-1.4 9.7,-23.6 13.2,-35.3 3.9,-12.6 7.9,-30.9 9.7,-43.5 0.6,-4.4 1.3,-9 1.6,-10.3 0.5,-2.6 0.9,-2.6 -11.6,-0.2z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M47,254.5c0,1.1 4.2,9 9.2,17.3l4.9,8.2 187.1,-0.2 187,-0.3 6.3,-10.5c3.5,-5.8 6.6,-11.5 7,-12.8l0.6,-2.2 -201,-0c-110.6,-0 -201.1,0.2 -201.1,0.5z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M79.9,305.7c1.3,2.4 10.4,11.1 16.7,16l5.2,4 144.7,0.7 144.6,0.7 6.7,-5.5c3.7,-3 9.4,-8.2 12.7,-11.5l5.9,-6.1 -168.7,-0c-160.4,-0 -168.7,0.1 -167.8,1.7z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M136.5,348.6c18.1,11.4 47.3,22.2 80.8,29.8 3.3,0.8 3.3,1.1 1.1,-18.2l-1.7,-14.2 -42.1,-0 -42.1,0.1 4,2.5z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M224,346.8c0,1.7 9.3,16.9 14.4,23.6 8.8,11.5 9.5,12.2 10.3,11 0.5,-0.5 2.9,-3.9 5.4,-7.5 4.4,-6 15.9,-25.8 15.9,-27.2 0,-0.4 -10.3,-0.7 -23,-0.7 -12.6,-0 -23,0.3 -23,0.8z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M276,361c-1.3,8.2 -2.1,15.2 -1.8,15.5 0.8,0.8 21.4,-3.9 35.8,-8 16.9,-4.9 42.8,-15.8 51,-21.4 1,-0.8 -11.5,-1.1 -40.6,-1.1l-42,-0 -2.4,15z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M358.2,401.7c-10.9,5.4 -6.5,22.3 5.8,22.3 6.3,-0 12,-5.8 12,-12.2 0,-3.6 -3.7,-8.8 -7.5,-10.4 -4.4,-1.8 -6.2,-1.7 -10.3,0.3z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M202,417.5l0,8.6 -2.8,-1.5c-11.9,-6.2 -27.1,0.5 -30.2,13.2 -4.2,17.7 13.9,32 30,23.7 2.7,-1.4 3,-1.4 3,-0 0,1.2 1.2,1.5 5.5,1.5l5.5,-0 0,-27 0,-27 -5.5,-0 -5.5,-0 0,8.5zM198.3,436c7.4,8.2 -1.5,21.1 -12.3,17.6 -4,-1.3 -8,-6.6 -8,-10.6 0,-4 4,-9.3 8,-10.6 4.5,-1.5 8.8,-0.2 12.3,3.6z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M263,417.5l0,8.6 -3.1,-1.7c-1.7,-0.8 -5.5,-1.8 -8.5,-2.1 -7.2,-0.8 -15.3,3 -19.2,9 -2.3,3.5 -2.7,5.1 -2.7,11.7 0,6.7 0.3,8.2 2.8,11.7 5.9,8.5 18.5,11.6 27,6.6 3.6,-2.2 3.7,-2.2 3.7,-0.3 0,1.7 0.7,2 5,2l5,-0 0,-27 0,-27 -5,-0 -5,-0 0,8.5zM257.2,434.2c1.5,1.1 3.3,3.6 3.9,5.7 3.1,10.4 -10.1,18.6 -18.1,11.3 -4.3,-3.8 -5.2,-8 -3.1,-12.8 3.2,-7.1 10.6,-8.9 17.3,-4.2z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M132.9,423.3c-8.4,4.5 -13,16.7 -9.9,26.2 3.7,11.2 16.6,17.2 28.3,13.1 2,-0.8 3.7,-1 3.7,-0.5 0,0.5 2.5,0.9 5.5,0.9l5.5,-0 0,-20.5 0,-20.5 -5.5,-0c-3,-0 -5.5,0.4 -5.5,0.9 0,0.6 -1.6,0.3 -3.5,-0.5 -5.3,-2.2 -13.4,-1.8 -18.6,0.9zM149,432.5c8,4.1 7.8,16 -0.4,19.9 -4.4,2.1 -6.4,2 -10.3,-0.4 -6.8,-4.1 -7.9,-12.2 -2.5,-17.2 4.4,-4.1 8.3,-4.8 13.2,-2.3z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M285.9,423.3c-8.2,4.4 -12.6,15.7 -10,25.5 0.7,2.6 2.8,6 5.4,8.6 6.1,6.4 14,8.2 22.6,5.1 2.2,-0.8 4.1,-1 4.1,-0.5 0,0.6 2.5,1 5.5,1l5.5,-0 0,-20.5 0,-20.5 -5.5,-0c-3,-0 -5.5,0.4 -5.5,0.9 0,0.6 -1.2,0.3 -2.7,-0.5 -4.5,-2.3 -14.2,-1.8 -19.4,0.9zM305.2,434.9c5,5.6 3.1,14.3 -3.7,17.6 -5.9,2.8 -12.5,0.1 -15.1,-6.2 -1.9,-4.5 -0.5,-9.2 3.9,-12.9 4.3,-3.7 10.9,-3 14.9,1.5z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M330.6,422c-5.4,1.7 -9.6,7.3 -9.6,12.8 0,1.6 1,4.4 2.3,6.3 2,3 3.2,3.6 11.1,5.6 4.9,1.2 9.3,2.6 9.9,3.2 2.7,2.7 -3.2,6.7 -8,5.5 -1.4,-0.4 -3.3,-2 -4.2,-3.5 -1.4,-2.6 -2.1,-2.9 -6.8,-2.9 -6.2,-0 -6.6,1.1 -3,7.4 3.2,5.6 7.6,7.6 16.5,7.6 12,-0 17.2,-4.2 17.2,-13.7 0,-7.3 -3.1,-10.6 -11.6,-12.2 -3.2,-0.7 -7.2,-1.4 -8.7,-1.7 -5.7,-1.1 -4.1,-6.4 1.9,-6.4 2.6,-0 3.9,0.7 5.6,3 1.9,2.6 2.8,3 7,3 4.2,-0 4.8,-0.3 4.8,-2 0,-3.5 -2.8,-7.7 -6.5,-10 -4,-2.5 -13.2,-3.5 -17.9,-2z" android:strokeColor="#00000000"/>
    <path android:fillColor="#000000"
        android:pathData="M217,442.5l0,20.5 5,-0 5,-0 0,-20.5 0,-20.5 -5,-0 -5,-0 0,20.5z" android:strokeColor="#00000000"/>
</vector>

我怎样才能做到这一点?我是iOS新手,谁能指导我?感谢帮助。

标签: objective-cuiimageview

解决方案


推荐阅读