我正在使用Apple的MailComposer示例应用程序从我的应用程序中发送电子邮件(OS 3.0功能).是否可以使用MFMailComposeViewController将To,Subject或Body字段设置为第一响应者?
换句话说,行为将是:用户按下呈现邮件视图的按钮(presentModalViewController).显示邮件视图时,光标将放置在其中一个字段中,并且键盘将打开.
我注意到MFMailComposeViewController文档说:
"重要提示:邮件撰写界面本身不可自定义,不得由您的应用程序修改.此外,在显示界面后,您的应用程序不允许对电子邮件内容进行进一步更改.用户仍可以使用接口,但程序化更改被忽略.因此,您必须在呈现界面之前设置内容字段的值."
但是,我不关心自定义界面.我只想设置firstResponder.有任何想法吗?
我正在使用HTML内容格式化邮件并使用MFMailComposeViewController发送它.但是在接收方端邮件未达到HTML格式.只有纯文本可见.我如何解决此问题.提前谢谢.
在故事板中,我可以设置从按钮到a的segue,UIViewController并使其以模态显示.这很好用.然而,当我在故事板从改变类UIViewController来MFMailComposeViewController,它不会在所有的工作.出现的只是顶部的导航栏,显示屏的其余部分用黑色填充.我采取了错误的做法吗?
cocoa-touch objective-c ios5 uistoryboard mfmailcomposeviewcontroller
我在我的应用程序中使用MFMailcomposerViewController.一切都很好,除了我需要有没有.收件人和用户发送给的收件人列表.有关此问题的任何帮助或解决方案..
我从这里找到了这个源代码并尝试使用它发送邮件.我成功获得了'MFMailComposeResultSent'消息,但未发送实际邮件.我不明白为什么不工作.另外,我附加了NSData中的图像,但它没有显示在mailcomposeview中.这段代码有什么问题?实际上,我只需要使用附件图像调用本机邮件应用程序,但我听说无法通过附件调用本机应用程序.请告诉我我的代码有什么问题.问题1:不从mailcomposeview发送邮件,问题2:不显示附加图像.最佳:运行附加图像的本机邮件应用程序.我很乐意等你的回答.谢谢.
-(void) sendMail
{
NSLog(@"Mail");
MFMailComposeViewController *mfMailView = [[MFMailComposeViewController alloc]init];
NSData *imgData = UIImagePNGRepresentation(imgPreview.image);
mfMailView.mailComposeDelegate = self;
[mfMailView addAttachmentData:imgData mimeType:@"image/png" fileName:@"Me.png"];
//also tried this
//[mfMailView addAttachmentData:imgData mimeType:@"image/png" fileName:@"Me"];
[mfMailView setSubject:@"TE~st"];
[mfMailView setMessageBody:@"Download Me~!" isHTML:YES];
[self presentModalViewController:mfMailView animated:YES];
}
-(void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result) {
case MFMailComposeResultCancelled:
NSLog(@"cancel?");
break;
case MFMailComposeResultSaved:
NSLog(@"saved?");
break;
case MFMailComposeResultSent:
NSLog(@"Sent succed");
[controller dismissModalViewControllerAnimated:YES];
break;
case MFMailComposeResultFailed:
NSLog(@"sent failue");
NSLog(@"%@",error);
break;
default:
break;
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个简单UITextView的电子邮件链接.textview是可选择的并检测链接.这样,您可以单击电子邮件,它以模态方式打开MFMailComposeViewController视图控制器.
但是,我在应用程序的启动时做了一些自定义:
[[UINavigationBar appearance] setBarTintColor: myGreyColor];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName: myFont}];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
Run Code Online (Sandbox Code Playgroud)
这样,所有导航栏都是灰色的,带有白色文本和白色按钮,标题具有自定义字体.
我的问题是所有这些都没有应用于邮件编辑器:栏是灰色的,标题是白色,但字体是默认的helvetica neue,按钮是默认的蓝色.而且,状态栏是黑色的,即使我的Info.plist说UIStatusBarStyleLightContent并View controller-based status bar appearance设置为NO.
我知道如何MFMailComposeViewController手动调用它时自定义,但它会自动弹出.如何将我的样式应用于它?
我正在尝试制作一个发送电子邮件的应用,MFMailComposeViewController但该类似乎没有提供设置电子邮件标头的方法.
我试图找到一个较低级别的解决方案(甚至是一个库)来完成这个但却找不到一个.如何在Objective-C应用程序中设置/获取电子邮件标头?
[编辑]为了清楚起见,我正在寻找一种通过MFMailComposeViewController提供的方式设置电子邮件标头的方法.我已经知道如何发送简单的电子邮件了.我正在寻找一种方法来设置电子邮件标题,如In-Reply-To或Message-ID
objective-c email-headers ios ios7 mfmailcomposeviewcontroller
我已经使用"applicationDidFinishLaunching"中的Appearance Proxy将UIBarButtonItem和UINavigationBar titleTextAttributes的外观更改为我的自定义Font以及颜色变为白色.每个导航标题文本和BarButtonItems都使用提供的自定义字体.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
UINavigationBar.appearance().barStyle = UIBarStyle.BlackTranslucent
UINavigationBar.appearance().barTintColor = NSFontAttributeName:SharedHelper.myCustomBarColor()
UINavigationBar.appearance().titleTextAttributes =[NSForegroundColorAttributeName:UIColor.whiteColor()]
UIBarButtonItem.appearance().tintColor = UIColor.whiteColor()
let attributes = [NSFontAttributeName:SharedHelper.customFontForBarButton()]
UIBarButtonItem.appearance().setTitleTextAttributes(attributes, forState: UIControlState.Normal)
return true
}
Run Code Online (Sandbox Code Playgroud)
当我使用MFMailComposeViewController发送电子邮件时出现问题.MFMailComposeViewController忽略字体属性并恢复为默认字体.在iPhone 5S模拟器中,我可以看到一段时间的自定义字体,但它恢复为默认字体.
在iPhone模拟器5S中显示了一段时间.(我想要完成这个)
几秒钟后使用默认字体.
对此有何帮助?外观代理不应该也适用于MFMailComposeViewController的UIBarButton和NavigationBar,或者是否需要对此进行编码?
我正在使用Swift,并尝试使用由Nove使用Bridge的appearanceWhenContainedIn,但似乎没有工作.我关心的是改变MFMailComposeViewController的titleText和BarButtonItems(取消,发送)的字体.
提前致谢.任何帮助将受到高度赞赏.
我在更改导航栏的背景颜色时遇到问题MFMessageComposeViewController.
我试过这段代码:
UINavigationBar.appearance().barTintColor = Configuration.Colors.navigationBarBackgroundColor
UINavigationBar.appearance().backgroundColor = UIColor.green
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Roboto-Regular", size: 18)!, NSForegroundColorAttributeName: UIColor.white] as [String: AnyObject]
let composer = MFMessageComposeViewController()
self?.present(composer, animated: true) {
UIApplication.shared.statusBarStyle = .lightContent
}
Run Code Online (Sandbox Code Playgroud)
这不起作用.最奇怪的是,当我做同样的事情时,它确实有效MFMailComposeViewController.
我也尝试直接在作曲家上改变颜色.
composer.navigationBar.tintColor = Configuration.Colors.navigationBarBackgroundColor
Run Code Online (Sandbox Code Playgroud) 使用Xcode 8.0重建已发布的应用程序,该应用程序使用PLCrashReporter,AWS Cognito/SNS和Google分析框架.
仅在iOS 10.x设备上看到,在运行我的测试存储桶期间不再显示邮件撰写vc.在Xcode控制台中,当到达if([MFMailComposeViewController.canSendMail])时,我会立即看到这些消息:
[MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
[MC] Filtering mail sheet accounts for bundle ID: [MY BUNDLE ID], source account management: 1
[MC] Result: YES
Run Code Online (Sandbox Code Playgroud)
我在这里找到了一种对这些控制台消息的引用:iOS 10上的UIActivityViewController崩溃
但我的应用程序不使用照片,我仍然尝试将链接中提到的照片隐私说明添加到我的info.plist中,但是当然没有快乐.问题依然存在.
我的应用程序确实使用相机,扫描条形码.相机隐私说明在info.plist中,自去年以来一直存在.该应用程序不使用其他需要隐私说明的功能.
连接iOS 9.3.5设备时,相同的准确代码和XC8设置按预期工作.
有人见过这个吗?
objective-c plcrashreporter ios10 xcode8 mfmailcomposeviewcontroller
mfmailcomposeviewcontroller ×10
ios ×6
iphone ×5
objective-c ×3
swift ×2
cocoa-touch ×1
email ×1
html ×1
ios10 ×1
ios4 ×1
ios5 ×1
ios7 ×1
sdk ×1
uikit ×1
uistoryboard ×1
uitextview ×1
xcode ×1
xcode8 ×1