1

I resolved the navigation bar status bar issue in all my views, but when I use presentModalViewController to show another view, navigation bar and status bar overlaps again.I am using this for presenting new view:

[self.parentViewController presentModalViewController:newController animated:YES];

Any idea to why this is happening?

Ganesh Kumar
  • 708
  • 6
  • 25
taman
  • 21
  • 4

2 Answers2

0

Try this code
1.your viewcontroller

UIViewController *View=[[UIViewController alloc]init];

2.If u need Navigation bar add this code

UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:View];

nav.modalPresentationStyle=UIModalPresentationFormSheet;(presentingModal view)

[self presentViewController:nav animated:YES completion:nil];
Ganesh Kumar
  • 708
  • 6
  • 25
  • Check this link and refer my answer http://stackoverflow.com/questions/25781169/how-to-fix-status-bar-overlap-issue-in-ios-7/25781823#25781823 and also check this link too. – Ganesh Kumar Sep 26 '14 at 11:42
0

For me, it worked by

  1. pushing the navigation bar and other views by 20 pixels for the view that i was presenting as modal view controller

  2. setting the black color background for status bar in viewDidload by:

    UIView *statusBarView =  [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1024, 20)];
    statusBarView.backgroundColor  =  [UIColor blackColor];
    [self.view addSubview:statusBarView];
    
Ganesh Kumar
  • 708
  • 6
  • 25
taman
  • 21
  • 4