0
votes

I THINK it is called the status bar? The one with the power meter, clock etc. Took me ages to work out to "hide" it but all it did was hide the icons, it is still taking real-estate. And so, when the wkwebview scrolls up, its scrolls under the status bar and looks awful.

I either want to completely hide the status bar or have it there but block colour so nothing can be seen under it. I have looked at 100 SO questions that talk about app settings in xcode, info.plist, appdelegate settings, viewcontroller settings, navigationcontroller settings (mine is hidden), but nothing gets round this.

Things Tried:

  1. UIStatusBarHidden=true in info.plist
  2. Project > General > Hide Status Bar = checked (guessing that's 1)
  3. UIViewControllerBasedStatusBarAppearance=false in info.plist
  4. This code in ViewController

    override func prefersStatusBarHidden() -> Bool { return true }

  5. in AppDelegate

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { application.statusBarHidden = true return true }

HELP PLEASE!

Screenshot:

enter image description here

3
Possible duplicate of How to hide iOS status barSaqib Omer
As mentioned not one fixed my issue.jenson-button-event

3 Answers

1
votes

Turns out I was previously compensating for the status bar being there with:

webView.scrollView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)

changed the top value to 0 and along with the 5 steps in the question and that has worked.

0
votes

You can get access to status bar via private API

- (UIView *)statusBarView {
    return [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
}
0
votes
  1. Try to go to your project settings by right-clicking it in Project navigator.
  2. Select General tab
  3. Scroll down and find checkbox "Hide status bar" in "Deployment Info" section