我在做一些愚蠢的事情嗎?我可以預先填充和電子郵件確定,但「\ r \ n」在emailBody被忽略:在setMessageBody中忽略新行和返回
- (void) sendEventInEmail
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *emailSubject = [eventDictionary objectForKey:EVENT_NAME_KEY];
[picker setSubject:emailSubject];
// Fill out the email body text
NSString *iTunesLink = @"http://itunes.apple.com/gb/app/whats-on-reading/id347859140?mt=8"; // Link to iTune App link
NSString *content = [eventDictionary objectForKey:@"Description"];
NSString *emailBody = [NSString stringWithFormat:@"%@\r\nSent using <a href = '%@'>What's On Reading</a> for the iPhone.", content, iTunesLink];
[picker setMessageBody:emailBody isHTML:YES];
picker.navigationBar.barStyle = UIBarStyleBlack;
[self presentModalViewController:picker animated:YES];
[picker release];
}
問候
戴夫
我把HTML設置爲YES,swi一直到沒有和新的線路工作。什麼是「和格式化代碼」? – quantumpotato 2011-02-03 17:47:09
@quantumpotato:你的工作是唯一的解決方案 – 2015-05-06 12:20:50