【问题标题】:Correctly closing of new ViewController pages正确关闭新的 ViewController 页面
【发布时间】:2016-04-24 21:47:05
【问题描述】:

请帮我关闭我的 ViewControllers。 我用这段代码打开了新的 ViewController(“SettingsPage”):

settingClass = storyboard?.instantiateViewControllerWithIdentifier("SettingsPage") as! SettingsClass
settingClass.modalPresentationStyle = .OverFullScreen
settingClass.modalTransitionStyle = .CrossDissolve
self.presentViewController(settingClass, animated: true, completion: nil)

然后我需要返回(关闭 SettingsPage),当我使用此方法时,我会得到双倍的 MainView

mainClass = storyboard?.instantiateViewControllerWithIdentifier("MainView") as! ViewController
mainClass.modalTransitionStyle = .CrossDissolve
self.presentViewController(mainClass, animated: true, completion: nil)

如何正确关闭像 .OverFullScreen 一样打开的新 ViewController(“SettingsPage”),然后返回到我的 MainView?

【问题讨论】:

    标签: ios swift viewcontroller presentviewcontroller uimodalpresentationstyle


    【解决方案1】:

    尝试像这样关闭它

    mainClass.dismissViewControllerAnimated(true, completion: {});
    

    【讨论】:

    • 谢谢!它在 ViewController 中的工作我想关闭我正在使用你的代码 self.dismissViewControllerAnimated(true, completion: nil)
    猜你喜欢
    • 2014-04-14
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多