iOS 13 UISplitView问题 [英] iOS 13 UISplitView Problems

查看:98
本文介绍了iOS 13 UISplitView问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 13 Beta 5上,我目前在iPhone上的UISplitView出现问题.

On iOS 13 Beta 5, I currently have problems with my UISplitView on iPhones.

我的应用程序从我的splitview的detailsview而不是masterview(查看图片)开始

My app starts with the detailsview off my splitview not with my masterview (look at the picture)

有人知道我如何在iOS 13下解决此问题?在iOS 12上,一切都像个魅力☹️

Does anyone know how i can fixed this problem under iOS 13? On iOS 12 everything works like a charm ☹️

提前塞巴斯蒂安

对不起,我回答我是在没有任何互联网的短暂假期中进行的:/

Sorry for the late answer I was on a short holiday trip without any internet :/

我的班级看起来像这样:

my Class looks like this:


class MyClass : UITableViewController, UISplitViewControllerDelegate, UIPickerViewDelegate {

override func viewDidLoad() {
        super.viewDidLoad()

        if (UIDevice.current.userInterfaceIdiom == .pad){
            navigationController?.navigationBar.isTranslucent = false
        }

        /*SplitView*/

        splitViewController?.preferredDisplayMode = .allVisible
        splitViewController?.delegate = self

        self.definesPresentationContext = true

}

    // SplitView
    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
        return true
    }

}


我认为这似乎是解决此问题的正常过程:/

I think it's look like the normal procedure for this problem :/

推荐答案

我遇到了同样的问题.

I had the same issue.

经过一番调查,看来viewDidLoad为时已晚,无法将其设置为全部可见.

After a bit of investigation it seems like viewDidLoad is too late to set it to all visible.

我继承了UISplitViewController的子类,并更改了awakeFromNib方法中的设置.现在它正在按预期方式工作.

I subclassed the UISplitViewController and changed the setting in awakeFromNib method. Now it is working as expected.

这篇关于iOS 13 UISplitView问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆