【问题标题】:ARKit Scene view blocked when go back from MFMailComposeViewController从 MFMailComposeViewController 返回时 ARKit 场景视图被阻止
【发布时间】:2018-05-31 14:27:33
【问题描述】:

当我从MFMailComposeViewController 回到ARSCNView 时,我遇到了一个问题,场景被阻塞,我仍然可以在被阻塞的屏幕上与 3D 模型 (hitTesting) 交互。

你有什么解决办法吗?

YM

【问题讨论】:

  • 被屏蔽是什么意思?
  • @JoshRobbins 当我从MFMailComposeViewController 回到ARSCNView 时屏幕被锁定:视频无法重新启动...
  • 你需要粘贴一些代码然后:)
  • @JoshRobbins 我解决了!

标签: ios arkit mfmailcomposeviewcontroller


【解决方案1】:

我的错。在我的ARSCNView 控制器上,我没有重置函数viewDidAppear 的配置。

解决它:

override open func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    // Prevent the screen from being dimmed to avoid interuppting the AR experience.
    UIApplication.shared.isIdleTimerDisabled = true

    // Start the `ARSession`.
    resetTracking()
}


func resetTracking() {
    let configuration = ARWorldTrackingConfiguration()
    session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
}

【讨论】:

    猜你喜欢
    • 2019-06-19
    • 1970-01-01
    • 2013-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-19
    • 2018-08-26
    • 1970-01-01
    相关资源
    最近更新 更多