How do you make a UINavigationBar transparent? Though I want its bar items to remain visible.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
After doing what everyone else said above, i.e.:
... my navigation bar was still white. So I added this line:
... et voila! That seemed to do the trick.
For anyone who wants to do this in Swift 2.x:
or Swift 3.x:
C# / Xamarin Solution
This works for Swift 2.0.
If anybody is wondering how to achieve this in iOS 7+, here's a solution (iOS 6 compatible too)
In Objective-C
In swift 3 (iOS 10)
In swift 2
Discussion
Setting
translucent
toYES
on the navigation bar does the trick, due to a behavior discussed in theUINavigationBar
documentation. I'll report here the relevant fragment:This seems to work: