uistatusbar

How to change UIViewControllerBasedStatusBarAppearance to YES/NO programmatically in iOS 7?

喜夏-厌秋 提交于 2019-12-22 08:09:20
问题 My application has a dark background, but in iOS 7 the status bar became transparent. So I can't see anything there, only green battery indicator in the corner. How can I change the status bar text color to Green or Orange like it is on the home screen? I know about Set the UIViewControllerBasedStatusBarAppearance to YES in the plist In viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate]; Add the following method: -(UIStatusBarStyle)preferredStatusBarStyle{ return

Write some text in (or on) UIStatusBar

ⅰ亾dé卋堺 提交于 2019-12-21 20:25:16
问题 I know, it's a strange question ^^, I would like to know if there is a way to write some text in (or on) the UIStatusBar. In particular I want to write some text on the Status Bar when the user press a UIButton. Thanks! 回答1: I'm not sure if you can draw directly into the status bar, but you should be able to draw on top of it in a custom view. You can get the status bar's frame using: CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame]; And you can get the application's

How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match?

旧巷老猫 提交于 2019-12-19 11:31:05
问题 In an app I'm developing (Xcode 5, >=iOS 7 auto-layout), I push a modal view controller. I want the modal view controller to have a navigation bar, so I add one, and add a constraint that positions it with it's top aligned with the top layout guide, so it is placed just under the status bar. (I'm using my own navigation bar because I want to take advantage of the system's management of the edit button and add button nav bar items. ) The standard navigation bar has a very subtle light gray

How to add custom navigation bar to a full-screen VC in iOS 7 and make it tint the status bar to match?

二次信任 提交于 2019-12-19 11:31:04
问题 In an app I'm developing (Xcode 5, >=iOS 7 auto-layout), I push a modal view controller. I want the modal view controller to have a navigation bar, so I add one, and add a constraint that positions it with it's top aligned with the top layout guide, so it is placed just under the status bar. (I'm using my own navigation bar because I want to take advantage of the system's management of the edit button and add button nav bar items. ) The standard navigation bar has a very subtle light gray

iPhone : HOWTO move status bar with pan gesture

痞子三分冷 提交于 2019-12-18 11:17:23
问题 Like Instagram - EXPLORE Tab, when I scroll the content, the status bar moves as well. Always called FullScreenScroll , like here, when the user scrolls the tableView, the NavigationBar & TabBar are scrolled to show or hide at the same time. My problem is, not only NavigationBar & TabBar, I also want to make the StatusBar follow the finger move. Finally, it is really fullscreen. 回答1: This is the best solution you can find to get status bar window UIWindow *statusBarWindow = (UIWindow *)[

UIStatusBarStyle not working in Swift

二次信任 提交于 2019-12-18 09:58:13
问题 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()

Status bar tint color changes to black in iOS 6

坚强是说给别人听的谎言 提交于 2019-12-18 03:43:36
问题 I am apparently not understanding how to use the status bar tint in iOS 6. I have read this question: Change statusbar tint colour but implementing the solutions suggested there has not resolved the issue. I have configured the settings in the target summary pane (default for style and tinting) and added the status bar tint parameters dictionary to my info.plist as described in WWDC 2012 Advanced Appearance Customization. My status bar tints correctly at launch but once I navigate to another

UIStatusBarStyle PreferredStatusBarStyle does not work on iOS 7

烈酒焚心 提交于 2019-12-17 07:01:15
问题 In my iPhone application built with Xcode 5 for iOS 7 I set UIViewControllerBasedStatusBarAppearance=YES in info.plist , and in my ViewController I have this code: -(UIStatusBarStyle) preferredStatusBarStyle { return UIStatusBarStyleLightContent; } But the status bar is still black against the black background. I know its possible to change this app-wide by setting UIViewControllerBasedStatusBarAppearance=NO in info.plist , but I actually need to alter this on a viewController by

How to set Status Bar Style in Swift 3

青春壹個敷衍的年華 提交于 2019-12-17 02:52:18
问题 I'm using Xcode 8.0 beta 4. In previous version, UIViewController have method to set the status bar style public func preferredStatusBarStyle() -> UIStatusBarStyle However, I found it changed to a "Get ONLY varaiable" in Swift 3. public var preferredStatusBarStyle: UIStatusBarStyle { get } How can provide the style to use in my UIViewController? 回答1: [UPDATED] For Xcode 10+ & Swift 4.2+ This is the preferred method for iOS 7 and higher In your application's Info.plist , set View controller

Hide UIStatusBar without removing the space allocated for it

折月煮酒 提交于 2019-12-13 14:11:37
问题 I have picture examples to show you what I want and what I have right now. First, here is an example of what I'm trying to do, from the Slack app: The statusbar is normally displayed: But when you open the side drawer, it goes away: I can display the status bar in my app: But when I hide it, it also hides the frame, so there is less space at the top than before: It looks wonky to remove space from the top whenever the side drawer opens, but it also looks bad to not hide the status bar since