Status bar and navigation bar issue in IOS7

前端 未结 11 1965
眼角桃花
眼角桃花 2020-11-22 10:10

I am migrating my application to iOS 7. For handing the status bar issue I have added this code

if([[[UIDevice currentDevice] systemVersion] floatValue] >         


        
11条回答
  •  广开言路
    2020-11-22 10:24

    i solved this by using below code

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     {
        if(landScape mode)
    
           if ([UIDevice currentDevice].systemVersion.floatValue>=7) {
            CGRect frame = self.window.frame;
           frame.size.width -= 20.0f;
          frame.origin.x+= 20.0f;
           self.window.frame = frame;
        }
    
    
     if(portrait)
    
        if ([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0) {
        [application setStatusBarStyle:UIStatusBarStyleLightContent];
    
        CGRect frame = self.window.frame;
        frame.origin.y += 20.0f;
        frame.size.height -= 20.0f;
        self.window.frame = frame;
    }
    return YES;
    
     }
    

提交回复
热议问题