是否有可能在Cocoa Touch中更改导航栏提示的文本颜色(即带有可选说明的区域)?可以使用此
更改文本[self.navigationItem setPrompt:@"My Prompt"];
但是这个文字的颜色怎么样?感谢。
答案 0 :(得分:-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]
}