Dou*_*ith 4 objective-c ios uiappearance ios7 mfmailcomposeviewcontroller
无论我似乎尝试什么,在用户选择通过电子邮件发送链接时出现的电子邮件屏幕(它是a 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] }];
Run Code Online (Sandbox Code Playgroud)
它确实为标题MFMailComposeViewController而不是按钮着色.我该如何做到这一点?
当我在其他地方把它变成白色时,它也会使我的状态栏保持黑色.
Ter*_*rry 16
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];
}];
Run Code Online (Sandbox Code Playgroud)
从iOS 6开始,MFMailComposeViewController(和其他一些视图控制器)在一个单独的进程上运行,因此它们不会继承应用程序中使用的样式.假设您正在使用最新的SDK,使用上述方法可能会有所帮助,至少可以在iOS 7上运行.您可以在此处详细了解远程视图控制器.
| 归档时间: |
|
| 查看次数: |
3640 次 |
| 最近记录: |