3
votes

Firstly, I'm French so; sorry for the english mistakes, I hope you'll understand my problem. I've only been working on iOS apps 3 months, maybe I havn't got all iOS development concepts.

I have an app correctly running on device and simulator using iOS 5 but when I try it on a iOS6 device or simulator I have a weird situation. A black bar appears at the top of the screen between the navigation bar and my tableview.

I did some research, others have the same problem but, what solved their problem didn't work for me. See: Black bar between navigation bar and table view appears on iOS 6

I'm facing this problem since I upgraded my xcode version to 4.5 and the iOS6 SDK. See the following screenshots of the simulator, firstly running iOS6 then iOS5. The weird thing is that the black bar is here just after the application is launched. If I changed tab (obviously viewcontrollers are switched) then the black bar is no longer present.

I try to change the first viewController by switching the element of my tabBar but the same situation appears even if I put the tab called "Tendances" in first. The black bar is on this view but not on the others.

I have made these screenshots on the iphone 3 simulator but using iphone4 or 5 simulator or a real device didn't resolve my issue.

Screenshot 1: I launch the application on a iOS6 simulator. You may see that the black bar is betwen the navigation bar and the tableView header.

Screenshot 1

Screenshot 2: I'm still running the same app on the same simulation (iOS6), I decided to switch tab, using the tabBarController. The black bar disappear.

Screenshot 2

Screenshot 3: I go back to the first tab then there is no black bar...

Screenshot 3

Screenshot 4: I closed the simulator running iOS6 for another running iOS5. I launched the app then as you may seen there is no black bar.

Screenshot 4

2
Auto resizing mask will help you. Check [this thread][1] [1]: stackoverflow.com/questions/12395200/…Praveen S
It's not just on iphone5 resolution, it's on every device which run iOS6Astral Walker
I also had this issue, and found the answer here: stackoverflow.com/questions/12547570/…Sandra Leclerc

2 Answers

2
votes

I had the exact same problem: when first launching the app / this tableviewcontroller (mine is a fetchedresultscontroller, just to be more clear), the navigation bar would shrink in height and a black bar would appear in between the navigation bar and the viewcontroller's items. If I switched to a different view controller (not a tableview one) and came back, the bar would be gone and the nav bar back to its normal size. I have spent my last 3 hours looking for answers and just trying everything out there but nothing worked for me.

What did work in my case is a pretty weird solution: making the navigation bar invisible and then visible once again. So it seems like this actually loads it twice, first time being with the black bar and the second one, back to normal.

In my viewDidLoad I have this now:

[self.navigationController setNavigationBarHidden:YES]; 

[self.navigationController setNavigationBarHidden:NO]; 
0
votes

Try this solution: How to set the top position = 0 after setStatusBarHidden:Yes?

I had once had the same issue, struggled through a lot of SO pages but this was the ultimate solution.