我在整个应用程序中使用绿色作为"动作颜色",我希望我的UIActionSheets中的选项也是绿色的,以保持一致性.如何将UIActionSheet选项的颜色从蓝色更改为绿色?
如何更改UIButton上文本的颜色.这是我目前的代码:
UIButton *b1 = [[UIButton alloc] init];
b1.frame = CGRectMake(280,395,30,30);
[[b1 layer] setCornerRadius:8.0f];
[[b1 layer] setMasksToBounds:YES];
[[b1 layer] setBorderWidth:1.0f];
[[b1 layer] setBackgroundColor:[botCol CGColor]];
b1.titleLabel.font = [UIFont boldSystemFontOfSize:24];
[b1 setTitleColor:[UIColor redColor] forState:UIControlEventAllEvents];
[b1 addTarget:self action:@selector(NextButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[b1 setTitle:@">" forState:UIControlStateNormal];
[self.view addSubview:b1];
Run Code Online (Sandbox Code Playgroud)
这是它的样子(忽略背景颜色和东西):
现在,我怎么能让箭头变成红色?如您所见,我已经有以下内容:
[b1 setTitleColor:[UIColor redColor] forState:UIControlEventAllEvents];
Run Code Online (Sandbox Code Playgroud)
但它不起作用.