我有这个代码,它在导航栏上创建了一个蓝色垃圾桶图标,我想将此图标的颜色更改为黑色。我该怎么做? 这是我的代码:
//add trash button to navigation bar
UIBarButtonItem *myTrash = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemTrash
target: self
action: @selector(deleteHandler)];
NSArray* barButtons = [self.navigationItem.rightBarButtonItems arrayByAddingObject: myTrash];
self.navigationItem.rightBarButtonItems = barButtons;
答案 0 :(得分:1)
您可以尝试更改整个窗口的色调(这将帮助您实现一致的色彩主题):
self.window.tintColor = [UIColor blackColor];
或导航栏的外观:
[UINavigationBar appearance].tintColor = [UIColor blackColor];