简体   繁体   中英

Auto Layout iOS7 -> iOS6 with status bar

I'm struggling with an issue using constraints under XCode 5.

I am building my app for iOS7 while trying to keep iOS6 UI compatibility.

I am currently facing one UI issue using Interface Builder.

I have a table view that adjusts according to the height of the superview using the constraints (set in Interface Builder).

It works perfectly under iOS7.1 portrait and landscape orientation.

My issue is that running on iOS 6.1, the views shrinks/enlarges depending of the superview height, BUT it goes 20pixels more on the bottom. It clearly is because of the status bar.

It doesn't make sense to me , since the autolayout should take care of this , right ?

I've tried to look for solutions here obviously, but i always find ways to go from iOS6 to iOS7 while preventing the view from showing under the status bar. It doesn't quite apply to my issue.

Any help on how I could/should solve this problem ?

Thx

Update the UIVIEW Frame programmatically when its ios version < 6

if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7) 
{ 
      // Update frame 
} 
else
{
    //Update the frame in UI
}

or check the below link, maybe its helpful

iOS 7 status bar back to iOS 6 default style in iPhone app?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM