sakoaskoaso
sakoaskoaso

Reputation: 347

Swift how to change tintColor of backIndicatorImage

I have got this code in AppDelegate U

INavigationBar.appearance().backIndicatorImage = #imageLiteral(resourceName: "backarrow")

And even though the image's color is white it shows it as blue.How can i change the tintcolor of this image?

Upvotes: 2

Views: 1118

Answers (2)

Baran
Baran

Reputation: 2820

Swift 5.x & Xcode 12 Solution:

let image = UIImage(named: "abc")!.withRenderingMode(.alwaysOriginal)
navigationBar.backIndicatorImage = image
navigationBar.backIndicatorTransitionMaskImage = image

Upvotes: 0

Bilal
Bilal

Reputation: 19156

  1. Go to Assets.xcassets
  2. Select your image backarrow
  3. Show the Attributes Inspector
  4. Change Render As value form Default to Original Image

enter image description here

Upvotes: 3

Related Questions