UIImagePickerController Navigation Bar Tint Color not working with iOS 13
This was resolved with rmaddy's solution in the comments.
in AppDelegate
implement;
func configureGlobalUI() {
UINavigationBar.appearance().tintColor = .red
}
then call in didFinishLaunchingWithOptions
This works as I require the tintColor
on all navigationBar
appearances.
iOS13 - problem with navigationBar title color
In iOS13 you need to set the title color on the UINavigationBarAppearance object - try adding this line to your code:
appearance.titleTextAttributes = [.foregroundColor: myAppLabelColor]
appearance.largeTitleTextAttributes = [.foregroundColor: myAppLabelColor]
What is the right way to set back button arrow tint in ios 13
The new way of setting the back button color of the appearance (proxy) would be:
let appearance = UINavigationBarAppearance()
// Apply the configuration option of your choice
appearance.configureWithTransparentBackground()
// Create button appearance, with the custom color
let buttonAppearance = UIBarButtonItemAppearance(style: .plain)
buttonAppearance.normal.titleTextAttributes = [.foregroundColor: UIColor.white]
// Apply button appearance
appearance.buttonAppearance = buttonAppearance
// Apply tint to the back arrow "chevron"
UINavigationBar.appearance().tintColor = UIColor.white
// Apply proxy
UINavigationBar.appearance().standardAppearance = appearance
// Perhaps you'd want to set these as well depending on your design:
UINavigationBar.appearance().compactAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
Incorrect navigation bar colour in limited library picker on iOS 15
The way to get completely control over a navigation bar's color is to use a background image. Make an image renderer. Fill the context with solid red and extract the image from the renderer. Call setBackgroundImage
on the appearance proxy.
I don't have time to translate the code from Swift to Objective-C so I leave it up to you:
let rend = UIGraphicsImageRenderer(size:.init(width:100, height:100))
let im = rend.image {
con in
UIColor.red.setFill()
con.fill(.init(x: 0, y: 0, width: 100, height: 100))
}
UINavigationBar.appearance().setBackgroundImage(im, for: .default)
In iOS13 the status bar background colour is different from the navigation bar in large text mode
No hacks or funkiness required here. The key is defining the desired appearance and setting this value on BOTH the nav bar's standardAppearance
AND its scrollEdgeAppearance
. I have the following in the init for my base navigation controller subclass for my entire app:
if #available(iOS 13.0, *) {
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.backgroundColor = <insert your color here>
navigationBar.standardAppearance = navBarAppearance
navigationBar.scrollEdgeAppearance = navBarAppearance
}
Tab & Navigation Bar changes after upgrading to XCode 13 (& iOS 15)
About Navigation Bar is black, try do it:
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .red
appearance.titleTextAttributes = [.font:
UIFont.boldSystemFont(ofSize: 20.0),
.foregroundColor: UIColor.white]
// Customizing our navigation bar
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance
I wrote a new article talking about it.
https://medium.com/@eduardosanti/uinavigationbar-is-black-on-ios-15-44e7852ea6f7
Related Topics
Create Endless Cgpath Without Framedrops
Firebase Storage Overwriting Files
Comparing Non-Optional Any to Nil Is Always False
How to Initialize a Mlmultiarray in Coreml
How to Catch Error When Setting Launchpath in Nstask
Swiftui View Property Willset & Didset Property Observers Not Working
How to Pass a Nil Value for One of the Parameter in Alamofire Post Request
iOS Swift - Uitableviewcell Custom Subclass Not Displaying Content
Swift 2, Protocol Extensions & Respondstoselector
How to Pass/Get Core Data Context in Swiftui Mvvm Viewmodel
Uisegment Value Changing When Tableview Get Scrolled
Adding Elements on Many-To-Many Relation
Take a Full Screenshot for All Webview in Swift
How to Find the Time Interval Remaining from Nstimer
Swift 3 Warning: Non-Optional Expression of Type 'String' Used in a Check for Optionals
Shows the Alert When Uitextfield's Are Full or Empty Swift
Swiftui Behavior of .Frame(Height: Nil)
How to Place Uisearchcontroller to the Navigationtitle and How to Enable and Disable It by Button