样式化navigationBar但保持navigationItem的默认样式

时间:2011-06-17 01:10:39

标签: iphone objective-c uinavigationcontroller

UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:self] autorelease];

nav.navigationBar.barStyle = UIBarStyleDefault;
nav.navigationBar.tintColor = [UIColor clearColor];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(closeMe:)] autorelease];
self.navigationItem.rightBarButtonItem.style = UIBarButtonItemStyleDone;

我想看看只有Done按钮。视图的背景是黑色的,所以Ive将navigationBar设置为黑色,但这也将Done按钮变为黑色,但我想保持蓝色。

Correct Button but has white gradient No gradient but button is Black

1 个答案:

答案 0 :(得分:2)

您必须使用自定义图像。

Button color in Navigation bar - iPhone