uistatusbar

Proper way to hide status bar on iOS, with animation and resizing root view

大憨熊 提交于 2019-11-30 01:24:51
Consider a view controller that needs to slide out (or hide) the status bar when a button is clicked. - (void) buttonClick:(id)sender { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; } The above effectively hides the status bar, but does not resize the root view appropriately, leaving a 20 pixel gap on top. What I expected is the root view to expand over the space that was previously used by the status bar (animated, with the same duration than the status bar animation). What's the proper way of doing this? (I'm aware there are plenty of

UIStatusBarStyle not working in Swift

拥有回忆 提交于 2019-11-29 18:58:58
I'm trying to change the Status Bar color in my Swift app to white, but am hitting a brick wall. I have 3 ViewControllers that are each embedded in a NavigationController (could that be the issue? I've already tried to place the code in the NavigationController class.) I've tried both of the following pieces of code in the didFinishLaunchingWithOptions of my AppDelegate.swift file but neither worked. application.statusBarStyle = .LightContent and UIApplication.sharedApplication().statusBarStyle = .LightContent All that the Docs have to say about it is that UIBarButtonStyle is an Int and gave

UIImagePickerController in iOS 7 status bar

核能气质少年 提交于 2019-11-29 11:02:53
In io7,the status bar on top a view is a nightmare.Fortunally i managed to make it work so it will be placed above the view.I did it like this: - (void)viewDidLoad { [super viewDidLoad]; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { self.view.backgroundColor=[UIColor colorWithRed:(152/255.0) green:(204/255.0) blue:(51/255.0) alpha:1] ; CGRect frame = self.topNav.frame; frame.origin.y = 20; self.topNav.frame = frame; } .... } Now my status bar is above my navigation bar. But when it comes to calling UIImagePickerController things are different.The above code has no effect.

Change the status bar background color color past iOS 7

不羁岁月 提交于 2019-11-29 06:31:55
问题 I want to change background color of status bar on iOS 7, and I'm using this code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [UIApplication sharedApplication].statusBarHidden = NO; self.window.clipsToBounds = YES; [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent]; self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20); self.window.bounds =

Can't get scrollsToTop working on iOS7

旧城冷巷雨未停 提交于 2019-11-29 02:28:28
问题 I'm targeting iOS7 in my latest app, and tapping on the status bar doesn't seem to scroll a tableView or collectionView to the top. I've set self.tableView.scrollsToTop = true and still nothing happens. I know Apple significantly changed the status bar in iOS7, but did those changes break the scrollsToTop functionality? Update In response to a comment in one of the answers, I tested to ensure that my collection view was indeed the only scrollView on the screen, and it was: (lldb) po [self

Changing the Color of the Status Bar

泪湿孤枕 提交于 2019-11-29 01:57:29
I am trying to change the color of the status bar to like a blue, or some other color. Is this possible, or does Apple not allow it? First in Plist set View controller-based status bar appearance to NO func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as! UIView if statusBar.responds(to:#selector(setter: UIView.backgroundColor)) { statusBar.backgroundColor = UIColor.blue }

Auto Layout and in-call status bar

喜欢而已 提交于 2019-11-29 01:29:59
I'd like to ask about Auto Layout and in-call status bar. Here's a simple scenario that demonstrates my problem: Create project with "Use Storyboards" enabled Add "View Controller" and enable its "Is Initial View Controller" Set background color of controller's view to red Add "Table View" into controller's view The table view should have 4 layout constraints (leading, top, trailing, bottom) to Superview with constant set to 0. Now when I run this app in Simulator and press ⌘ + T I can see red background while the in-call status bar animates in. Is it possible to get rid of this glitch? herzi

UIStatusBar as in Facebook new iOS7 application

倾然丶 夕夏残阳落幕 提交于 2019-11-29 01:11:47
问题 I have an app with side bar menu, kinda like Facebook side bar menu. I'm using this class called SWRevealViewController and it's working great. Now since iOS7 has came out, I just can't figure out how to adjust my Status and Navigation Bar to be like in Facebook app. As you can see, in the Facebook app, when the user slides the screen and open's the menu, the status bar turn from the Navigation Bar blue color to black with Fade animation. In my app, the user slides the screen to open the menu

Proper way to hide status bar on iOS, with animation and resizing root view

戏子无情 提交于 2019-11-28 22:14:09
问题 Consider a view controller that needs to slide out (or hide) the status bar when a button is clicked. - (void) buttonClick:(id)sender { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; } The above effectively hides the status bar, but does not resize the root view appropriately, leaving a 20 pixel gap on top. What I expected is the root view to expand over the space that was previously used by the status bar (animated, with the same duration

UINavigationBar/Status Bar issue in IOS7

谁说胖子不能爱 提交于 2019-11-28 15:43:20
Final EDIT (Rather than having an overly long question with edits making a final edit for clarification, please see other edits if needed). Controller Setup I have an application that is setup as follows: InitialViewController (subclass of ECSlidingViewController ) Main Navigation Controller (subclass of UINavigationController ) Main Home View Controller (subclass of UIViewController ) In the viewDidLoad of the initialViewController I load the main navigation controller in with the Home View Controller as its root. self.topViewController = [self.storyboard