Ios 需要更改标题栏颜色吗
需要更改导航栏标题颜色。 诸如此类:Ios 需要更改标题栏颜色吗,ios,objective-c,Ios,Objective C,需要更改导航栏标题颜色。 诸如此类: self.navigationItem.title.color = [UIColor yellowColor]; 希望这对你有帮助 你可以给任何时尚的你想标题的导航栏,只要这样做 UILabel *lblNavTitle = [[UILabel alloc] initWithFrame:CGRectMake(x, y, width, height)]; lblNavTitle.backgroundColor = [UIColor clearColo
self.navigationItem.title.color = [UIColor yellowColor];
希望这对你有帮助 你可以给任何时尚的你想标题的导航栏,只要这样做
UILabel *lblNavTitle = [[UILabel alloc] initWithFrame:CGRectMake(x, y, width, height)];
lblNavTitle.backgroundColor = [UIColor clearColor];
lblNavTitle.textAlignment = NSTextAlignmentCenter;
lblNavTitle.textColor = [UIColor whiteColor];//this what you want
lblNavTitle.text = NSLocalizedString(@"Volunteers", @"");
[lblNavTitle sizeToFit];
self.navigationItem.titleView = lblNavTitle;
更多
转到您需要说明您的目标iOS版本。有两种不同的方法可以做到这一点:iOS 7之前的版本或iOS 7及更高版本。
-(void)viewDidLoad
{
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8];
shadow.shadowOffset = CGSizeMake(0, 1);
// In dictionary you can set your own color
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], NSForegroundColorAttributeName,shadow, NSShadowAttributeName,[UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:21.0], NSFontAttributeName, nil]];
}