我正在开发具有最新SDK的iOS应用。在iOS应用上使用android形状xml资源
我有一个Android应用程序,我这样做资源:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gauge_background">
<gradient
android:startColor="#449def"
android:endColor="#2f6699"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners android:radius="30dp" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
</shape>
,并想在我的iOS应用程序来使用它。
你知道是否有一种方法来加载这个XML并将其显示为UIView backgroundColor?
事情是这样的:
self.backgroundColor =
[[UIColor alloc] initWithPatternImage:[UIImage imageNamed:imageName]];