Wiingaard
Wiingaard

Reputation: 4302

Status bar blocking UI

I'm running code from xcode on my iPhone. The blue status bar, saying it has an connection to xcode, is allway there.

  1. Does it have to be there, in order to program to the phone?

  2. Is there a way to set the views bounds to the visible part of the screen? Maybe a way (or what is best practice) to update the visible bounds of the screen, when a change in the status bar occurs, so that it changes the bounds for all view controllers?

I hope this isn't a too trivial question, howeven i havn't been able to solve it by searching.

enter image description here

Upvotes: 1

Views: 723

Answers (3)

Daniel Storm
Daniel Storm

Reputation: 18888

That blue notification bar is showing because you are sharing an internet connection with your computer. Not because you are connected to Xcode. Turn off your Personal Hotspot in your devices settings.

On your device navigate to: Settings > Cellular > Turn off Personal Hotspot

You can get the height of the status bar like so:

UIApplication.sharedApplication().statusBarFrame.size.height

Using Auto Layout to deal with any status bar changes would be easiest in my opinion. Pin your UIView to the bottom of your status bar in Interface Builder.

Upvotes: 1

Natasha
Natasha

Reputation: 6893

Select the View Controller and uncheck the box saying "Under the Topbar". That way your views should not go under the status bar, but the blue bar in your screen shot is not because of the status bar as others have indicated.

enter image description here

Upvotes: 1

Palle
Palle

Reputation: 12109

To answer your first question: No, the blue bar does not have to be there. In fact, it is not related to Xcode in any way, it just says, that your computer uses the internet connection of your iPhone. To turn this off, go to Settings>Personal Hotspot and switch it off.

Upvotes: 0

Related Questions