如何自定义 MFMailComposeViewController 的导航栏颜色?
从这段代码将以原始颜色显示我如何将其更改为另一种颜色? 也许需要覆盖它?
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
[mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
[mail setSubject:@"support"];
[mail setMessageBody:@"enter your message here" isHTML:NO];
[self presentModalViewController:mail animated:YES];
}
from this code will show in original color how can i change it to another color?
maybe it need to be override?
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
[mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
[mail setSubject:@"support"];
[mail setMessageBody:@"enter your message here" isHTML:NO];
[self presentModalViewController:mail animated:YES];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有这样做,所以请谨慎对待这个答案。
MFMailComposeViewController
继承自UINavigationController
。这意味着它将有一个navigationBar
属性。获得导航栏后,您可以修改其tintColor
属性。I haven't done this so take this answer with appropriate caution.
MFMailComposeViewController
inherits fromUINavigationController
. That means it'll have anavigationBar
property. Once you have the navigationBar you can modify itstintColor
property.实际上,iPhone SDK 禁止您修改 MFMailComposeViewController 的外观。从文档(此处):
抱歉...
Actually, the iPhone SDK prohibits you from modifying the appearance MFMailComposeViewController. From the docs (here):
Sorry...
自 Apple Docs 中的更高版本 iOS 起你应该使用 UIAppearance 协议
As of later versions of iOS in Apple Docs you should use UIAppearance protocol