【问题标题】:Animated segue from xib view to ViewController从 xib 视图到 ViewController 的动画转场
【发布时间】:2016-02-23 19:35:21
【问题描述】:

我有一个名为thirdView.xib 和“allPicsViewController”的视图(所以没有Storyboard Segue)。我的问题是,如果可以执行动画转场(Cross Dissolve 是最好的),而不是从底部开始的普通动画。

这段代码显示了我的“allPicsViewController”并且它可以工作,但是视图从底部开始动画。

func showProfileController(){  
        let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let vc: UIViewController = storyboard.instantiateViewControllerWithIdentifier("allPicsViewController")
        self.presentViewController(vc, animated: true, completion: nil)

        print("btn tapped")       
    }

我也尝试设置 animated:false ,但这并不好。 谢谢。

【问题讨论】:

    标签: ios xcode swift animation uistoryboardsegue


    【解决方案1】:

    根据我上面的评论(帮助其他人):

    刚刚设置

    vc.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve 
    

    在展示视图控制器之前。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-18
      • 2019-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-20
      • 2020-06-02
      • 2016-06-05
      相关资源
      最近更新 更多