小编Pep*_*epo的帖子

iOS 13 - 右栏按钮项目在模态表演示中偏移

我在 iOS 13 及其新的表单卡样式模式演示中遇到了这个奇怪的问题。

从 ViewController1 我模态呈现嵌入在 NavigationController 中的 ViewController2,一切正常。
从 ViewController2,我然后模态呈现嵌入在 NavigationController 中的 ViewController3,我得到了右栏按钮偏移量。

这是问题的视频:有人解决了吗?

我究竟做错了什么?

主视图控制器

import UIKit

let vc1identifier = "vc1identifier"
let vc2identifier = "vc2identifier"

class ViewController: UIViewController {

@IBAction func tap1(_ sender: UIButton) {
    if let navigation = self.storyboard?.instantiateViewController(withIdentifier: vc1identifier) as? UINavigationController,
        let nextVC = navigation.contentViewController as? UnoViewController {

        //self.navigationController?.pushViewController(nextVC, animated: true)
        self.present(navigation, animated: true, completion: nil)
    }
}
}

extension UIViewController {
var contentViewController: UIViewController {
    if let navcon = self as? UINavigationController {
        return navcon.visibleViewController! …
Run Code Online (Sandbox Code Playgroud)

xcode swift ios13

6
推荐指数
1
解决办法
787
查看次数

标签 统计

ios13 ×1

swift ×1

xcode ×1