iPhone/Objective-C-更改默认的"navigationItem.prompt"颜色 [英] iPhone/Objective-C - Change default "navigationItem.prompt" color

查看:62
本文介绍了iPhone/Objective-C-更改默认的"navigationItem.prompt"颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将self.navigationItem.prompt颜色设置为白色?目前是黑色.

Is there a way to set the self.navigationItem.prompt color to White? At the moment it's Black.

这是我现在设置NavigationBar颜色的方式:

This is how I'm setting my navigationBar color at the moment:

// Set top navigation bar.
UINavigationBar *bar = [navController navigationBar];
[bar setTintColor:[UIColor colorWithRed:180.0/255.0 green:25.0/255.0 blue:34.0/255.0 alpha:1]];
UIImageView *navBar = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
[navBar release];

..这就是我设置navigationItem.prompt的方式:

..and this is how I'm setting my navigationItem.prompt:

self.navigationItem.prompt = @"Tap image for more options.";

推荐答案

Swift:

        self.navigationController?.navigationBar.titleTextAttributes =
                 [NSForegroundColorAttributeName : UIColor.white]
        self.navigationController?.navigationBar.barTintColor = UIColor.red

这篇关于iPhone/Objective-C-更改默认的"navigationItem.prompt"颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆