This commit is contained in:
2026-09-24 16:25:22 +08:00
commit 7428184f01
1198 changed files with 314515 additions and 0 deletions
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
</dict>
</plist>
@@ -0,0 +1,7 @@
{
"deploymentTarget": "12",
"dependencies-pods": [{
"name": "SVGKit",
"version": "3.0.0"
}]
}
@@ -0,0 +1,40 @@
import {
UIButton,
UIControl,
UIImageView,
UIImage
} from "UIKit"
import { SVGKImage } from "SVGKit" assert { type: "implementationOnly" };
import { UTSComponent } from "DCloudUTSFoundation"
import { Data } from 'Assignables';
import { CALayer } from 'QuartzCore';
import { CGRect, CGSize } from 'CoreFoundation';
export class xSvgU {
$element : UniNativeViewElement;
targetView : UIImageView | null = null;
constructor(element : UniNativeViewElement) {
this.$element = element;
this.targetView = new UIImageView()
this.$element.bindIOSView(this.targetView!);
}
setImage(newval : string) {
if (newval != '') {
let url = UTSiOS.getResourcePath(newval)
// let width = (16).toInt();
// let height = (16).toInt();
// this.targetView!.frame = new CGRect(x = 0, y = 0, width = width, height = height);
const size:CGRect = this.targetView!.frame;
let svgURL = new URL(fileURLWithPath = url)
let svgData = UTSiOS.try(new Data(contentsOf = svgURL),"?")
if(svgData==null) return;
let svgImage = new SVGKImage(data = svgData!)
svgImage!.size = new CGSize(width= size.width, height= size.height)
this.targetView!.image = svgImage?.uiImage
}
}
}