mfmailcomposeviewcontroller

MFMailComposeViewController in landscape

无人久伴 提交于 2019-12-01 22:21:05
问题 My application is in landscape mod.When i call MFMailComposeViewController through Present model view, it comes in landscape mod.I rotate device and MFMailComposeViewController view goes to portrait mod i want to restrict this rotation it should always be in landscape mod only.Is there any way to do it.. 回答1: Subclass the MFMailComposeViewController class, so that you can override its shouldAutorotateToInterfaceOrientation to display it however you like: @interface MailCompose :

Pushing an MFMailComposeViewController onto the navigation stack? Not presented modally

人走茶凉 提交于 2019-12-01 19:06:03
I have a table view, and in one of the cells, it says "contact". Upon selecting this cell, I'd like to push in a MFMailComposeViewController. I can only seem to present this MFMailComposeViewController modally. What is the problem here? Thanks! Relevant code frag: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; //*works*//[self.navigationController presentModalViewController:controller animated:YES]; //*broken*//[self.navigationController pushViewController

UIImageView.Image to mail attachment with MonoTouch

徘徊边缘 提交于 2019-12-01 18:32:11
I am new to MonoTouch and I am trying to send an email with an image as attachment that a user will tame from camera or pick from gallery. I have created the program and it runs correctly (I have an imageview controller which loads an image from uiimagepicker to imageview. Then I call MFMailComposeViewController but I don't know how to pass the image from imageview to addAttachmentdata method. I suppose first I have to save the image from imageview as a file but I don't know how to do it and I can't find documentation for it. First you need to turn the UIImage into an NSData , e.g. using AsPNG

MFMessageComposeViewController cancel button not working

China☆狼群 提交于 2019-12-01 16:26:51
I use this block to send message to the contacts, after sending, the back button is there, but when I touch it nothing happens. Please help me out :) -(IBAction) InviteIt:(id) sender{ if ([MFMessageComposeViewController canSendText]) { MFMessageComposeViewController *messageComposer = [[MFMessageComposeViewController alloc] init]; messageComposer.messageComposeDelegate = self; NSString *message = @"You have more body buddies than you think at: http://www.itunes.com/app/JoyChain "; [messageComposer setBody:message]; messageComposer.recipients = [NSArray arrayWithObjects:_itsnum, nil];

How to change buttons in MFMailComposeViewController?

主宰稳场 提交于 2019-12-01 15:20:18
In my app I am using the MFMailComposeViewController. I have placed a back and Done button in the title bar. I have the title bar to be in black color, but I have the button background in blue color. How to change the button background color to black in color? You first have to change the button style: barButton.style = UIBarButtonItemStyleBordered; Afterwards, the color of the navigation bar buttons can be changed with the following code: [[mailComposer navigationBar] setTintColor:[UIColor blackColor]]; I followed this to add custom buttons replacing the standard cancel and send buttons: //

How to change buttons in MFMailComposeViewController?

ぃ、小莉子 提交于 2019-12-01 15:02:37
问题 In my app I am using the MFMailComposeViewController. I have placed a back and Done button in the title bar. I have the title bar to be in black color, but I have the button background in blue color. How to change the button background color to black in color? 回答1: You first have to change the button style: barButton.style = UIBarButtonItemStyleBordered; Afterwards, the color of the navigation bar buttons can be changed with the following code: [[mailComposer navigationBar] setTintColor:

MFMessageComposeViewController cancel button not working

柔情痞子 提交于 2019-12-01 14:09:24
问题 I use this block to send message to the contacts, after sending, the back button is there, but when I touch it nothing happens. Please help me out :) -(IBAction) InviteIt:(id) sender{ if ([MFMessageComposeViewController canSendText]) { MFMessageComposeViewController *messageComposer = [[MFMessageComposeViewController alloc] init]; messageComposer.messageComposeDelegate = self; NSString *message = @"You have more body buddies than you think at: http://www.itunes.com/app/JoyChain ";

presentModalViewController crashes my app

放肆的年华 提交于 2019-12-01 01:16:15
It's one of the simplest things to do, I know. But I've been banging my head against this for days. I've done it plenty of times in the past, but for some reason trying to present a modal view controller just crashes the app to a black screen. Nothing reported in the console or anything. I'm hoping someone might have had this problem and has some advice. This code is called from a UIViewController class: MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"test subject"]; [controller setMessageBody

Email CSV file with MFMailComposer

本秂侑毒 提交于 2019-12-01 00:58:50
I would like to create a file using a NSString (already made) with a .csv extension then email it using the UIMessage framework. So can someone show me the code to create a file (with a .csv extensions and with the contents of a NSString) then how to attach it to a MFMailComposeViewController. This is how you attach a CSV file to a MFMailComposeViewController: MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; [mailer setSubject:@"CSV File"]; [mailer addAttachmentData:[NSData dataWithContentsOfFile:@"PathToFile.csv"] mimeType:@

Disable editing on MFMailComposeViewController

。_饼干妹妹 提交于 2019-12-01 00:48:21
We have a business rule where we need to restrict the editing of the email body content on MFMailComposeViewController. The content will be pre-populated and needs to remain static. Is it possible to grab the UITextView object and set it to disabled or something along those lines? Another thought was to display a clear view over the top of the UITextView to prevent any interaction. Any ideas? Ok, so yes, the answer is that it is impossible without using private APIs . I managed to do it with the following code. - (void) getMFComposeBodyFieldViewFromView:(UIView *)view { for (UIView *item in