disable tint on custom uibarbuttonitem images

前端 未结 2 1680
北恋
北恋 2021-01-12 06:20

i have some custom bar button items in my navigation controller.

\"enter

(maxi

相关标签:
2条回答
  • 2021-01-12 07:05

    Adding to Anindya Answer:

    In Xcode 9.2,

    You can change the "Render As" property to "Original" in Attribute Inspector of Assets. This will prevent NavigationBar.TintColor to take effect on that Image if you used it in UIBarButtonItem

    0 讨论(0)
  • 2021-01-12 07:19

    In iOS 7, a navigation bar’s tintColor affects the color of the back indicator image, button titles, and button images. The barTintColor property affects the color of the bar itself. So, you can try setting the barTintColor and check if it solves your issue.

    Also, when using the barButtonItem images, the following code is worth a try:

    myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    0 讨论(0)
提交回复
热议问题