Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dark background behind UINavigationBar in push transition from UICollectionViewController with iOS 7.1

I'm having a little problem when trying to go to the next UIViewController from a UICollectionViewController. The problem is: While the next view is pushed, a black background seems to be added behind the right side of the navigation bar. I tried to replace the next view controller but the problem is still there. But when replacing the UICollectionViewController with another one, the problem vanishes.

Note: this problem seems to be an iOS 7.1 bug. Because i don't remember that it happened before I updated my devices.

Here is a Video of my problem if you didn't understand me

Anyone can help ?

Thank you all in advance and sorry for my english,

Bader

like image 631
Bader Al-Rasheed Avatar asked Mar 28 '14 19:03

Bader Al-Rasheed


3 Answers

Setting self.navigationController.view.backgroundColor to the color you want will solve this problem.

like image 50
noark Avatar answered Nov 18 '22 19:11

noark


I had exactly the same problem. It's a bug. UINavigationController view has a black background, and it spoils translucent Navigation Bar at transition time. To resolve this issue, you should change background of UINavigationController in code by this way: self.navigationController.view.backgroundColor = [UIColor whiteColor];

Or set view color of UINavigationController in Interface Builder: enter image description here

like image 43
Igor Avatar answered Nov 18 '22 21:11

Igor


Ok, i finally knew what caused this problem. That was because i added an ILTranslucentView as a subview of a UICollectionView cell. Also, using a UIToolbar instead causes the same issue ( i still believe this is an iOS 7.1 bug because this wasn't happening before ).

Solution: remove any UIToolbar from your view controller.

like image 2
Bader Al-Rasheed Avatar answered Nov 18 '22 20:11

Bader Al-Rasheed