我有以下代码:问题改变UIToolbar tintColor
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
webControlsToolbar_ = [[UIToolbar alloc] init];
[self.webControlsToolbar_ setTintColor:[UIColor colorWithRed:246.0/255.0 green:246.0/255.0 blue:246.0/255.0 alpha:1]];
任何想法,为什么颜色仍然是黑色实?在我看来没有负载我添加了工具栏:
self.webControlsToolbar_.frame = CGRectMake(0, self.view.frameHeight - self.webControlsToolbar_.frameHeight + 1.0, self.view.frameWidth, self.webControlsToolbar_.frameHeight);
[self.view addSubview:self.webControlsToolbar_];
您可以显示代码显示工具栏的位置吗?此外,为什么工具栏初始化了两次? – Aaron 2012-02-23 20:30:33
编辑上面的代码,双重初始化只是一个输入错误 – adit 2012-02-23 20:33:48
'self.webControlsToolbar_'是一个IBOutlet吗? – Aaron 2012-02-23 20:36:54