[英]customize UIBarButtonItem in Navigation Bar
I was trying to customizing the UIBarButtonItem in Navigation Bar 我试图在导航栏中自定义UIBarButtonItem
I found that there is a property in UIBarButtonItem : "tintColor" , and I set it like this 我发现UIBarButtonItem中有一个属性:“ tintColor”,我这样设置
self.navigationItem.leftBarButtonItem.tintColor = [UIColor redColor];
It works well, but if I try this : 它运作良好,但是如果我尝试这样做:
self.navigationItem.leftBarButtonItem.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"imageName"]];
1 . 1 。 It doesn't work as expect , however , the leftBarButtonItem shows a black appearance ,why ?
它不能按预期工作,但是leftBarButtonItem显示为黑色外观,为什么?
If I try a clearColor : 如果我尝试clearColor :
self.navigationItem.leftBarButtonItem.tintColor = [UIColor clearColor];
2 . 2 。 The leftBarButtonItem shows a black appearance still, why ?
leftBarButtonItem仍显示为黑色外观,为什么?
3 . 3 。 I want to customize it with a pattern image like above , how can I do that ?
我想使用上面的图案图像对其进行自定义,我该怎么做?
Thank you 谢谢
您可以检查此示例代码以自定义导航栏和后退按钮https://github.com/boctor/idev-recipes/tree/master/CustomBackButton
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.