是否可以仅对带有小屏幕的iPhone隐藏我的应用程序状态栏?谢谢
iPhone 5、5s和se的屏幕宽度为320。在您的AppDelegate
中,您可以执行以下操作:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UIScreen.main.bounds.width == 320 {
application.isStatusBarHidden = true
}
return true
}
然后转到您的信息。请添加一个新值: View controller-based status bar appearance
将值设置为NO
。现在,状态栏将被隐藏针对iPhone 5、5s和SE。