可以为基于自定义视图的UIBarButtonItem使用色调颜色吗?

时间:2018-06-19 08:08:25

标签: ios uibarbuttonitem

是否可以像普通UIBarButtonItem一样使用基于UIBarButtonItem的cutomview?

UIBarButtonItem *update = [[UIBarButtonItem alloc] initWithCustomView:b];

或者它知道哪种色调是默认颜色?

我应该使用标准色调(0,122,255)重新着色图像吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试像这样设置图片:

UIImage(named: "imagename")?.withRenderingMode(.alwaysTemplate)

您也可以在资产目录中将Render As设置为Template Image

相关问题