代码之家  ›  专栏  ›  技术社区  ›  TheoK

将内置的当前UIViewController动画与其他动画同步

  •  0
  • TheoK  · 技术社区  · 8 年前

    有没有办法同步内置的 UIViewController 动画与其他动画?

    我提出我的建议 UIViewController 使用 present(_:animated:completion:)

    在纽约 UIViewController 我更改状态栏的背景颜色如下:

    UIApplication.shared.statusBarView?.backgroundColor = UIColor.red
    

    (我已经延长了期限。) UIApplication 类,所以我有一个属性 statusBarView 它回来了 UIApplication.shared.value(forKey: "statusBar") as? UIView )

    我还将状态栏更改为 .lightContent 从…起 .default

    有没有办法同步内置的 UIViewController 使用状态栏上的动画呈现动画(更改为 .轻内容 和 backgroundColor ),还是我必须创建自定义的过渡动画?

    1 回复  |  直到 8 年前
        1
  •  0
  •   Syed faizan ali    8 年前

    是的,你可以用简单的动画,

    UIView.animate(duration: 0.6, animate: {//You can do whatever you want with the presented view }, completion: {//present the desired view controller})