gpt4 book ai didi

ios - 设备旋转动画在 iOS 10 中不起作用

转载 作者:行者123 更新时间:2023-11-28 08:16:34 25 4
gpt4 key购买 nike

我有以下问题,在几个地方搜索,但我找不到解决方案,因为我在 AppDelegatedidFinishLaunchingWithOptions 中添加了一些代码行,确定哪个 View Controller 将在开始时启动,并使用关闭应用程序之前保存的数据加载数组,当旋转设备时,在模拟器或我的 iPhone 中,旋转时不会生成动画。

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.lightContent
}

UINavigationBar.appearance().barTintColor = UIColor(red: 252/255.0, green: 140.0/255.0, blue: 90.0/255.0, alpha: 1)
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.white]
UIToolbar.appearance().barTintColor = UIColor(red: 252/255.0, green: 140.0/255.0, blue: 90.0/255.0, alpha: 1)
UIBarButtonItem.appearance().tintColor = UIColor.white

self.window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard (name: "Main", bundle: nil)

...
}

这里是动图:

enter image description here

最佳答案

设备方向自动旋转动画

问题

  • iOS 11:工作
  • iOS 9、10:不工作

解决方案

If you have 'Main Interface' and custom window setting in AppDelegate, DELETE one.

我通过删除“目标 - 通用 - 主界面”解决了这个问题。 (将其设为空白。)
但是,我仍然不知道为什么设置主界面会出现这个问题。

关于ios - 设备旋转动画在 iOS 10 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42430083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com