I would like to set the background color of a menu to that of the navigation bar. What is the best way to do this?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
In Swift, it is:
Swift 4
I am not sure the color does not change from version to version. In my app I use this:
To get the tint color of a navigation bar, do this:
By using this when you set the background color of your menu, you will not have to change it in case you change your navigation bar tint.
Swift 3.0 +
UIColor(red: (247/255), green: (247/255), blue: (247/255), alpha: 1)
The default navbar color in iOS 7 is
[UIColor colorWithRed:(247.0f/255.0f) green:(247.0f/255.0f) blue:(247.0f/255.0f) alpha:1];
Swift 4