禁用自定义uibarbuttonitem图像上的色调 [英] disable tint on custom uibarbuttonitem images

查看:96
本文介绍了禁用自定义uibarbuttonitem图像上的色调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的导航控制器中有一些自定义栏按钮项。

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

最大化图像以更好地查看边框

上面的屏幕截图是它应该是什么样子以及我如何添加barbutton项目图像。你可以看到,
,图标顶部有一些较暗的渐变。

the above screenshot is how it should look like and how i added the barbutton item image. as you can see, the icon has some darker gradients on top.

但是由于所有图标都被着色,这个黑色渐变也会变成白色和我的图标看起来非常模糊。

but since all icons get tinted, this dark gradient gets also tinted white and my icon looks extremely blurry.

我把它们放到我的故事板中。

i just dropped them into my storyboard.

有没有办法禁用这个barbuttonitems的着色?

is there a way to disable tinting this barbuttonitems?

推荐答案

在iOS 7中,导航栏的 tintColor 会影响后退指示灯的颜色图像,按钮标题和按钮图像。 barTintColor 属性会影响条形图本身的颜色。因此,您可以尝试设置 barTintColor 并检查它是否解决了您的问题。

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.

此外,使用barButtonItem时图片,以下代码值得一试:

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

myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

这篇关于禁用自定义uibarbuttonitem图像上的色调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆