无论我似乎尝试什么,当用户选择通过电子邮件发送链接时出现的电子邮件屏幕中(这是一个MFMailComposeViewController
)按钮始终默认为蓝色。
我的 AppDelegate 中有这个:
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.000 green:156/255.0 blue:51/255.0 alpha:1]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName: [UIColor whiteColor] }];
它确实给标题增添了色彩MFMailComposeViewController
但不是按钮。我该如何做到这一点?
当我在其他地方将状态栏设置为白色时,它也会使我的状态栏保持黑色。
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setToRecipients: [NSArray arrayWithObjects:@"recipients", nil]];
[mailController setSubject: @"Contact Us"];
[mailController setMessageBody: @"Mail Body" isHTML:NO];
[[mailController navigationBar] setTintColor: [UIColor blackColor]]; //color
[self presentViewController: mailController animated:YES completion:^{
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];
}];
从 iOS 6 开始,MFMailComposeViewController(以及其他一些视图控制器)在单独的进程上运行,因此它们不会继承应用程序中使用的样式。假设您使用的是最新的 SDK,使用上述方法可能会有所帮助,至少在 iOS 7 上有效。您可以在此处阅读有关远程视图控制器的更多信息。 http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)