Reputation: 2668
How can i remove the UINavigationController top rounded corners?Is there any plist property or i need to do this programmatically?
I want to go from this:
To this:
Upvotes: 3
Views: 1642
Reputation: 399
Just change the status bar style from "Black Opaque" to "Black Translucent" and all 4 corners of your rootViewController won't be rounded anymore. As long as you don't set your view controller's property wantsFullScreenLayout = YES
nothing will be drawn behind the status bar. Your UIWindow must have backgroundColor = [UIColor blackColor]
so the user can't notice that the status bar isn't real "Black Opaque".
Upvotes: 5
Reputation: 1155
I believe Sascha may be correct when he says that rounded corners are automatically added when you use a black status bar. I noticed that in one of my new apps, my UINavigationController had rounded corners and a black status bar, even though i had not set it in the xib file, the info.plist file or even the App Delegate.
I did a quick test and swapped the image I was using for the UINavigationController/NavigationBar background and discovered that the nav bar color was automatically affecting the status bar, which in turn was rounding the corners of the nav bar (weird)
See snapshots of my nav bar (The rounded corners are being generated purely by virtue of the color of the image I am using as my UINavigationController's background!)
So I guess in your case - One suggestion would have been to try a different color background and see if you have the same results as I did.
Upvotes: 2
Reputation: 5973
Well, the default look is the look in the image on the bottom. So what did you do, to get the look of the top image in the first place? My guess is, that you use an image as the background of the UINavigationBar. Find the image and replace it with a version without rounded corners.
An alternative is a UINavigationBar subclass. In that case you might look for that subclass and see if there is a line similar to [self.layer setCornerRadius:3.0]
and remove it.
Upvotes: 3