I want the UINavigationBar in my app to be completely transparent and flush with the viewcontroller directly under it. However, the only code I could find makes it translucent but not transparent. I know this can be done in iOS 7 because it is used in the notes app. My question is, what is the code they used to do it?
相关问题
- Image loads in simulator but not device?
- UIModalTransitionStyleFlipHorizontal flips Vertica
- Xcode4 templates now use underscore on iVars?
- Is it possible to have a element transparent and s
- How can i associate an IBAction event with an imag
相关文章
- Xcode: Is there a way to change line spacing (UI L
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Navigation bar disappears when typing in UISearchC
- How to get a CGImageRef from Context-Drawn Images?
- Why are my UIView layer properties not being set w
- create UIImageView
- How to set different navigationbar color for diffe
- Can I add a border to an SKSpriteNode, similar to
Use UINavigationBar+Addition pod, then simply call:
Alan forgot one line
So I have:
[(UIView*)[self.navigationController.navigationBar.subviews objectAtIndex:0] setAlpha:0.0f];
That one line seemed to work perfectly for me
For Swift3 and Swift4
For Swift2.2
For Objective-C
From this answer
Also, as suggested by Josh in the comments, to put the bar back to default:
Swift 4.2 and iOS 12
It turns out all you really need is the code below. It works perfectly when you put it into
viewDidLoad()
.