我的应用程序具有导航栏的自定义背景。所以我做了一个这样的分类
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect
{
UIImage *image = [UIImage imageNamed: @"image.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
在我的应用程序中,我必须使用 MFMailComposeViewController。我创建它就像
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
但是 Apple 的文档说明了这一点
Important The mail composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is not allowed to make further changes to the email content. The user may still edit the content using the interface, but programmatic changes are ignored. Thus, you must set the values of content fields before presenting the interface.
所以这意味着我不能将我的“image.png”保留为邮件编辑器 View Controller 的导航栏背景。
如何做到这一点?
谢谢
最佳答案
简而言之,您不能使用标准的苹果 MFMailComposeViewController。您通常会以模态方式呈现它,因此无论如何它都会完全超出您的视野。
如果您想要自定义外观的撰写表,则必须将其创建为具有自定义 View 的自定义 Controller 。您还需要在您的应用程序中内置一个邮件服务器,或者您可以点击它来为您发送邮件的服务器。
出于安全原因,Apple 限制了您可以使用 MFMailComposeViewController 执行的操作。
如果我能提供更多帮助,请务必询问 :)
关于ios - MFMailComposeViewController 导航条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9047404/