iphone - 在 MFMailComposeViewController 中更改导航的主标题颜色

标签 iphone objective-c xcode cocoa-touch

在普通 viewController 上更改导航主标题的颜色没有问题,但在 MFMailComposeViewController 上,这是不可能的。 我可以更改按钮的颜色(取消和发送),我可以设置导航栏的背景但不能更改标题的颜色。我不想设置新标题(显然,Apple 不允许),我只想更改颜色:'(

请帮帮我。 谢谢

最佳答案

NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                            [UIColor whiteColor],UITextAttributeTextColor, 
                                            [UIColor blackColor], UITextAttributeTextShadowColor, 
                                            [NSValue valueWithUIOffset:UIOffsetMake(-1, 0)], UITextAttributeTextShadowOffset, nil];

[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];

或者

navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor yellowColor] forKey:UITextAttributeTextColor];

希望它对你有用..

关于iphone - 在 MFMailComposeViewController 中更改导航的主标题颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10996537/

相关文章:

ios - 带有尾随空格的 UILabel 不能正确居中

objective-c - 具有相同名称的 Swift 和 Objective-C 类

ios - 在发薪日应用程序中为货币添加逗号

ios - 从不同的 Xcode 项目加载 Storyboard

iphone - 我应该为哪些核心数据错误做准备?

iphone - TabBarController的框架受模态弹出的影响

iphone - 如何在iPhone中解析网页,以及如何从该网页的表格中获取部分数据?

IOS table view inside 一个 TableView

xcode - 字符串 : Minimum bounds for maximum height

iPhone 开发者 : UIWebView baseUrl to resources in Documents folder not App bundle