enter image description here
类我的自定义UI视图控制器:UI视图控制器{让指导覆盖= AR指导覆盖视图()
override func viewDidLoad() {
let arView = ARView(frame: .zero)
let session = arView.session
// this is a view that display standardized onbording instructions to direct users towards specific goal.
let coachingOverly = ARCoachingOverlayView()
// this is an intger bit mask that determines how the reciever resized itself.
coachingOverly.autoresizingMask = [.flexibleWidth,.flexibleHeight]
coachingOverly.goal = .anyPlane
coachingOverly.session = session
arView.addSubview(coachingOverly)
// Load the "Opject" scene from the "dumu" Reality File
let anchor = try! Dumu.loadScene()
// Add the Opject anchor to the scene
arView.scene.anchors.append(anchor)
self.view.addSubview(arView)
}
override func viewWillAppear(_ animated: Bool) {
coachingOverly.setActive(true, animated: true)
}
}
1条答案
按热度按时间bf1o4zei1#
从ARViewContainer中的图片我看到....
在
但接下来要示例化一个新的UIView以返回
它看起来是一个UIView,你返回它。但是你必须返回一个ARView,它是UIView的子类。也许你可以用
也可以在定义中将MyCustomUIViewController()的类改为ARView。要获得更详细的解释,我至少需要MyCustomUIViewController()的定义