2

UIView of my app appears fine in ios6 but when it comes to ios7 the entire view is distorted. In ios7 the whole view is lifted upwards.

EDIT :

Then I applied this code:

float SystemVersion=[[[UIDevice currentDevice] systemVersion] floatValue];

if(SystemVersion<7.0f)
{

    //Currently your app is running in IOS6 or older version. So you need not to do     anything.

}
else
{
    // Currently your app is running in IOS7. Do the following.

    CGRect TempRect;
    for(UIView *sub in [[self view] subviews])
    {
        TempRect=[sub frame];
        TempRect.origin.y+=20.0f; //Height of status bar
        [sub setFrame:TempRect];
    }
}

but still there is no change. How do I resolve this?

Midhun Raj
  • 201
  • 1
  • 2
  • 5
  • 1
    Try this way.. [IOS & DISPLAY][1] OR This.. [Status Bar Issue][2] [1]: http://stackoverflow.com/a/19042940/1673099 [2]: http://stackoverflow.com/questions/19158325/status-bar-issue – user1673099 Oct 04 '13 at 05:17
  • Possible duplicate of http://stackoverflow.com/questions/18894541/after-updating-to-ios-7-all-views-in-ios-6-moved-up-and-are-hidden-by-the-naviga – Puneet Sharma Oct 04 '13 at 05:17
  • I got the same problem. – user4951 Oct 04 '13 at 05:22

5 Answers5

0

Try this way..

IOS & DISPLAY

OR

This..

Status Bar Issue

This way make the your All subviews as +20 pixels i.e.Increase the +20 of y-axis for all views Set the deleta for the ios 7. so, it will display the good in both ios 6 & 7.

Community
  • 1
  • 1
user1673099
  • 3,293
  • 7
  • 26
  • 57
0

//Give it frame if navigation bar and status bar both displaying on screen
// first check if device have ios 7
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
{
self.view.frame=CGRectMake(0,64,320,self.view.height);
}

Jignesh Mayani
  • 6,937
  • 1
  • 20
  • 36
0

try my answer...write that code in ViewdidLoad method..

Status Bar issue

Happy Coding!!!

Community
  • 1
  • 1
NiravPatel
  • 3,260
  • 2
  • 21
  • 31
0

Please see below note

Using xcode 5,

click on xib,Go to file inspector and change setting as below

Deployment target as ios 7

here,You need to crate two xib view based on view as ios 7 and later and view as ios 6 and earlier and white condition based on xib call

Define below code in .m file

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

if view as IOS 7.0 and later

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))

 //Here call ios 7 xib

}else{

 //Here call ios 6 and earlier xib

}

Chris Alan
  • 1,426
  • 14
  • 14
-2

You have to create two xib for ios6 and ios7.

than You have to check condition if device is of ios7 than call ios7 xib otherwise go for ios6.

Shreyansh Shah
  • 101
  • 1
  • 11