样条 iOS 嵌入

问题描述 投票:0回答:1

我正在尝试将 spline.design 嵌入到我的 SwiftUI 应用程序中,并使用生成的本机代码并简单地复制和粘贴它,我得到:

spline scene file is in an unknown format
import SplineRuntime

struct Onboarding3DView: View {
    var body: some View {
        // fetching from cloud
        let url = URL(string: "https://build.spline.design/JHA7PO5Xk7h6trzn-wYc/scene.splineswift")!

        // // fetching from local
        // let url = Bundle.main.url(forResource: "scene", withExtension: "splineswift")!

        try? SplineView(sceneFileURL: url).ignoresSafeArea(.all)
    }
}

这是我的代码,项目运行良好,但错误不是显示 3D 元素,

在 iPhone 14 Pro Max 上测试

swift swiftui spline
1个回答
0
投票

根据 Spline 文档,此错误意味着“导出的文件太旧,运行时太旧,或者文件可能已损坏。”

尝试重新导出您的文件

© www.soinside.com 2019 - 2024. All rights reserved.