Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 需要更改标题栏颜色吗_Ios_Objective C - Fatal编程技术网

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]];

}