The display screen for iOS6 and iOS7 in the simulator is different

enter image description here

enter image description here

My application I will provide the target 6.1, so the display on 7.0 and the display screen 6.1 will differ so as to adjust the size in both 6.1 and 7.0

+1
source share
4 answers

The difference between the main interfaces in iOS 6 and iOS 7 is that the status bar is turned on inside the view manager in iOS 7. This means that your view controller is 20 pixels larger than iOS6. You must adjust your subjects. First create your elements in accordance with iOS 6, which is better, and you have to practice a lot of it, now set Δy to 20 for each element.

iOS 7 Δy -20

+5

ios7.0 , secrren, autolayout

+1

Add this code to your AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
     //Whatever your code goes here
  if(kDeviceiPad){

     //adding status bar for IOS7 ipad
         if (IS_IOS7) {
              UIView *addStatusBar = [[UIView alloc] init];
              addStatusBar.frame = CGRectMake(0, 0, 1024, 20);
              addStatusBar.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; //change this to match your navigation bar
              [self.window.rootViewController.view addSubview:addStatusBar];
                    }
                }
    else{

         //adding status bar for IOS7 iphone
        if (IS_IOS7) {
            UIView *addStatusBar = [[UIView alloc] init];
            addStatusBar.frame = CGRectMake(0, 0, 320, 20);
            addStatusBar.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; //You can give your own color pattern
            [self.window.rootViewController.view addSubview:addStatusBar];
        }

    return YES;
   }
0
source

It may be useful.

-(void)adjustFrameForiOS7:(UIView*)v
{
    if([UIDevice currentDevice].systemVersion.floatValue >=7.0)
    {
        [v setFrame:CGRectMake(v.frame.origin.x, v.frame.origin.y+20, v.frame.size.width, v.frame.size.height)];
    }
    else
    {
        [v setFrame:CGRectMake(v.frame.origin.x, v.frame.origin.y, v.frame.size.width, v.frame.size.height)];
    }
}
0
source

All Articles