我想刪除屏幕頂部的狀態(tài)欄。這不起作用:func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: NSDictionary?)-> Bool{ application.statusBarHidden = true return true}我也嘗試過:func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: NSDictionary?)-> Bool{ self.window = UIWindow(frame: UIScreen.mainScreen().bounds) var controller = UIViewController() application.statusBarHidden = true controller.setNeedsStatusBarAppearanceUpdate() var view = UIView(frame: CGRectMake(0, 0, 320, 568)) view.backgroundColor = UIColor.redColor() controller.view = view var label = UILabel(frame: CGRectMake(0, 0, 200, 21)) label.center = CGPointMake(160, 284) label.textAlignment = NSTextAlignment.Center label.text = "Hello World" controller.view.addSubview(label) self.window!.rootViewController = controller self.window!.makeKeyAndVisible() return true}
如何在Swift iOS應(yīng)用中隱藏狀態(tài)欄?
呼啦一陣風(fēng)
2019-11-23 10:28:14