Status Bar issue

前端 未结 2 734
迷失自我
迷失自我 2021-01-03 13:15

As you can see from my image, the status bar is displaying on top of my table view and i don\'t understand what i have done wrong for this to happen. i am sure that it will

2条回答
  •  星月不相逢
    2021-01-03 13:28

    you can avoid this problem by writing below code in ViewDidLoad method...

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

    let me know it is working or not my friend!!!

    Happy Coding!!!!

提交回复
热议问题