我有以下代碼:問題改變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