Joe Jordan
Joe Jordan

Reputation: 11

How to show status bar in storyboard of Xcode

I'm trying to develop an app that has a navigation controller at the top. When viewing the app on the storyboard as an iPhone 7 Plus, the status bar is visible, and the layout is correct. When viewing as any other device, the status bar is missing, and the layout is off by 20px. I also get a "misplaced view" warning.

I believe this has to do with the issue working while developing on my work computer, but then when I switch to my laptop, the Misplaced View errors start happening.

When running the app, the app works fine and looks as it should regardless of the device, but with everything off like this, it's hard to develop.

Did I change some default setting on my laptop to not show the status bar on some views in the storyboard view? Thanks for any help!

iPhone 7 example showing no status bar in storyboard view, as well as incorrect placement of cells / views / images

EDIT:

Update: At work (different Mac running Xcode with the same project files, the status bar shows on every preview (meaning no misplaced views). It's got to be something with my Xcode settings at home. Any ideas?

Upvotes: 0

Views: 9008

Answers (4)

Joe Jordan
Joe Jordan

Reputation: 11

Uninstalling and reinstalling Xcode on the mac with the issue seemed to solve the problem. I'm sure it's a bug.

Upvotes: 1

Nirmalsinh Rathod
Nirmalsinh Rathod

Reputation: 5186

You need to change the value of "Status Bar" value and its visible into storyboard.enter image description here

Upvotes: 1

Ram
Ram

Reputation: 969

you can do it as

override var prefersStatusBarHidden: Bool {
    return false
}

Upvotes: 0

Misha
Misha

Reputation: 685

This is nit the issue with your VC but is with NavigationController, so select your NavigationVC and check mark the option underTopBars,

NavigationController attribute inspector

Upvotes: 0

Related Questions