在普通 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/