Daxesh Nagar
Daxesh Nagar

Reputation: 1415

Display screen for iOS6 and iOS7 in simulator is different

enter image description here

enter image description here

My application i will give deployment target 6.1 so in 7.0 display and 6.1 display screen different so how to adjust the size in both 6.1 and 7.0

Upvotes: 1

Views: 1109

Answers (4)

AsifHabib
AsifHabib

Reputation: 950

Main UI difference in iOS 6 and iOS 7 is that status bar is included inside the viewcontroller in iOS 7. it means your view controller is 20 px greater than iOS6. you have to adjust your items. First design your items according to iOS 6 which is better way and you must have a lot of practice of doing that, now set Δy to 20 for every item.

Or design your items according to iOS 7 and set Δy to -20

Upvotes: 5

Tendulkar
Tendulkar

Reputation: 5540

It may be helpful

-(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)];
    }
}

Upvotes: 0

Vizllx
Vizllx

Reputation: 9246

Add this code in 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;
   }

Upvotes: 0

Sanjay Kumar Yadav
Sanjay Kumar Yadav

Reputation: 151

use ios7.0 and later and then handle the secrren size using autolayout

Upvotes: 1

Related Questions