Tag: tintcolor

改变UIBarButtonItem的色调

我有一个使用故事板的项目,每当我用一个segue推动视图控制器时,dynamic创build的栏button项总是蓝色的。 这让我疯狂。 因为这个对象是dynamic创build的,所以我不能在IB中设置它的颜色(就像我之前的barbutton项目所做的那样)。 我尝试过的解决scheme是: 将其设置在接收者的viewDidLoad 将其设置在接收者的viewDidAppear self.navigationItem.backBarButtonItem.tintColor = [UIColor whiteColor]; 当我看到这不太有效,我试着设置leftBarButtonItem: self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor]; 我已经尝试了下面的代码(我从其他答案中得到)在我的应用程序的委托,当新视图被调用,并在推新视图之前: [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; 我find的所有谷歌答案build议使用上面的代码,但它根本不工作。 也许iOS 7的外观API有一些变化? 无论我怎样或在哪里设置“Categorías”为白色,它总是默认的蓝色。

更改UISearchBar上的光标颜色而不更改tintColor

我想我的searchBar的色调是白色的(这意味着取消button是白色的)。 当色调为白色时,光标不可见。 有没有办法分别设置光标颜色?

在UIImageView上使用Tint颜色

我有我自己的UIButton的子类。 我添加UIImageView并添加图像。 我想用色调来描绘图像,但不起作用。 到目前为止我有: – (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor clearColor]; self.clipsToBounds = YES; self.circleView = [[UIView alloc]init]; self.circleView.backgroundColor = [UIColor whiteColor]; self.circleView.layer.borderColor = [[Color getGraySeparatorColor]CGColor]; self.circleView.layer.borderWidth = 1; self.circleView.userInteractionEnabled = NO; self.circleView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:self.circleView]; self.iconView = [[UIImageView alloc]init]; [self.iconView setContentMode:UIViewContentModeScaleAspectFit]; UIImage * image = [UIImage […]

更改全局色调 – iOS7 / iOS8

我们如何才能通过代码更改iOS7 / iOS8上的全局色调颜色 ? 我想更改使用此属性的多个对象,但不会更改每个对象,这就是为什么我想要使用全局tint属性。