Fry
Fry

Reputation: 6275

How can I prevent view content from going under the status bar in iOS7?

I have an app compiled for iOS7 and 6, but is very difficult manage the different behavior of the status bar. There is a way to prevent the content going under the status bar ?

Thanks.

Upvotes: 3

Views: 1365

Answers (2)

Greg
Greg

Reputation: 33650

In iOS7, the status bar always overlaps your view controller's view. It's up to you how you want to position subviews such that they do not go under the status bar.

If you are not using auto layout, you can use the iOS 6/7 deltas on the size inspector in interface builder to adjust the position of elements in iOS 6/7 as appropriate (usually by setting the y delta to -20 on iOS 7).

iOS 6/7 deltas

If you are using auto layout, you can create a vertical constraint between your views and the top layout guide to ensure that they are positioned correctly. Just control-drag from the top layout guide to your top-most view.

control-drag from top layout guide to view

choose vertical spacing

Upvotes: 2

Manuel M.
Manuel M.

Reputation: 4515

Have a look here:

http://www.doubleencore.com/2013/09/developers-guide-to-the-ios-7-status-bar/

at Supporting Older Versions of iOS Alongside iOS 7 section and use Deltas parameters.

It might help!

Upvotes: 0

Related Questions