0
我希望我的leftBarButtonItem爲紅色按鈕。我還沒有想出如何做到這一點。我使用下面的代碼來構造導航欄和按鈕。 任何幫助表示讚賞。 LQ如何更改UINavigation的顏色leftBarButtonItem
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
navBar.barStyle = UIBarStyleBlack;
navBar.translucent = YES;
[self.view addSubview:navBar];
[navBar release];
UIBarButtonItem *clearButton = [[UIBarButtonItem alloc]
initWithTitle:@"Clear"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(myAction:)];
navItem.leftBarButtonItem = clearButton;
[navBar pushNavigationItem:navItem animated:false];
[navBar setDelegate:self];
[navItem release];
[clearButton release];
感謝要走的路。我從來沒有想過使用UISegmentedControl。 – 2011-04-10 21:10:04