Navigation bar becomes transparent when set to translucent
I’m using XCode 5.02 and iOS7 SDK.
I’m trying to set my navigation bars as translucent but when I do that, they become completely transparent instead. The status bar will also be transparent. I can see the title and buttons on the navigation bar but no background. The same happens in all view controllers in my project, so this is not bound to specific view. When I set translucent = NO, I get solid colors.
This is both in the simulator and on a device running iOS7.
I have tried setting translucent to ON in the .plist file and also tried setting it directly in code like this in viewDidLoad and viewWillAppear:
self.navigationController.navigationBar.translucent = YES
Any ideas appreciated.
- Swift- custom UITableViewCell delegate to UIViewController only one protocol works
- Whose view is not in the window hierarchy issue?
- Is it ok to create a UIView on a background thread?
- Keep a UIView or UIViewController on top of all others
- opening and closing other UIViewControllers - any other approaches than to use protocol & delegate?
- UIViewController's prefersStatusBarHidden not working
2 Solutions Collect From Internet About “Navigation bar becomes transparent when set to translucent”
I had the same problem setting my navigation bars as translucent but when I do that, they become completely transparent instead
select Use Autolayout option in file inspector.this may solve your problem too.
Did you try the option to select
Translucent Navigation Bar in the Attributes inspector ?
View Controller selected, click on
Attributes inspector and from there,
you may select the respective type of
Top Bar that suits you from a drop down list.
here is a screenshot:
- UIApplication sharedApplication – keyWindow is nil?
- How To Reload Dictionaries On Tableview By Segment Button Click Using Objective C?
- Copy Folder (w/contents) from bundle to Documents directory – iOS
- CloudKit – What to do when a user adds, modifies or deletes an object while offline?
- How can I add padding to the intrinsic content size of UILabel?
- Add subview to a xib file
- iOS Swift Bluetooth Keyboard keypress detection
- xcodebuild Code Sign error: No matching codesigning identity found:
- kCVPixelFormatType_420YpCbCr8BiPlanarFullRange frame to UIImage conversion
- How to display a PDF document that includes hyperlinks? (on iOS)
- How to use stringWithContentsOfURL:encoding:error:?
- Universal iOS app crashing on iPhone/iTouch 3.1.3 due to UIPopoverController
- iOS HealthKit how to save Heart Rate (bpm) values? Swift
- iOS property declaration clarification
- XCode 4: Multiple Targets, Multiple Resources Folders with images of the same name to use with a shared Xib?