0

Cocoa Touch 中导航栏提示(即有可选说明的区域)的文字颜色是否可以改变?可以使用此更改文本

[self.navigationItem setPrompt:@"My Prompt"];

但是这个文本的颜色呢?谢谢。

4

1 回答 1

-1

您可以在导航中添加 UILabel 并设置它的颜色

-(void) viewDidLoad {
    UILabel *theLabel = [ [UILabel alloc ] initWithFrame:CGRectMake((self.bounds.size.width / 2), 0.0, 150.0, 43.0) ];
theLabel.textAlignment =  UITextAlignmentCenter;
theLabel.textColor = [UIColor whiteColor];
theLabel.backgroundColor = [UIColor blackColor];
theLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:(36.0)];



    UIView *myLabel = (make a view and add "theLabel" to it)


    UIBarButtonItem *myBarButtonItem = [[UIBarButtonItem alloc] initWithCutomView:myLabel];
    [self.navigationController.navigationItem setRightBarButtonItem:myBarButtonItem animated:NO]

}
于 2012-04-23T12:47:51.683 回答