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.
Thank you.
I had the same problem setting my navigation bars as translucent but when I do that, they become completely transparent instead
Try this:
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 ?
with your 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:
来源:https://stackoverflow.com/questions/21181499/navigation-bar-becomes-transparent-when-set-to-translucent