Search code examples
iosxcode5xcode6statusbarnavigationbar

Status bar, navbar margin


I'm adding my searchController to my current controller, it's working fine when I'm using xcode 5.1.1, but when I upgraded to xcode 6, it gives me problem. I notice that it doesn't count the status bar's height in UI, in the homepage it doesn't count the height of navbar too. but when I go to second page, it counts the height of status bar and nav bar.

CGRectMake(0, 64, 320, 44) this is the frame of my searchBar.


Solution

  • I've solve this by getting the frame of the added child controller by getting it's height and add or subtract.

    CGRect frame = searchView.view.frame; frame.origin.y += 64; // add or subtract searchView.view.frame = frame;

    I think this is not the proper way, any suggestion guys ?

    Did xcode 6 didn't count the statusBar's height and navigationBar's height ?