我似乎无法取代过时的sizeWithFont
与boundingRecWithSize
正确.我仔细检查了所有的答案,并熬夜试图解决这个问题.我真的需要一些比我聪明的人的帮助.这是我试图修改的代码.任何帮助,将不胜感激.
CGSize sizeForText = [faqItem.answer sizeWithFont:[UIFont boldSystemFontOfSize:14]
constrainedToSize:CGSizeMake(self.tblView.bounds.size.width - padding, MAXFLOAT)
lineBreakMode:NSLineBreakByWordWrapping];
[sectionInfo insertObject:[NSNumber numberWithFloat:roundf(sizeForText.height + 5)]
inRowHeightsAtIndex:0];
Run Code Online (Sandbox Code Playgroud) 在iOS 6中,MFMailComposeViewController
如果用户尝试发送第二封电子邮件,则不会解散...
第一次出现并发送电子邮件,一切都很完美.但是,如果再次选择电子邮件选项,则MFMailComposeViewController
取消时不会解除.
这是我实现它的方式:
- (IBAction)buttonEmailClick:(id)sender {
if (![MFMailComposeViewController canSendMail]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can't send" message:@"This device is unable to send emails." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
return;
}
NSDictionary *contactsInfo = [self contactsInfoFromPlistNamed:kConfigPlistName];
[mailComposeViewController setToRecipients:[NSArray arrayWithObject:[contactsInfo objectForKey:@"email"]]];
//[mailComposeViewController setSubject:kEmailDefaultSubject];
//[mailComposeViewController setMessageBody:text isHTML:NO];
[self presentModalViewController:mailComposeViewController animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
然后这个:
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
UIAlertView *alert = nil;
if (result == MFMailComposeResultSent) {
alert = [[UIAlertView alloc] initWithTitle:@"Sent" message:@"Your email was sent." delegate:nil cancelButtonTitle:@"OK" …
Run Code Online (Sandbox Code Playgroud)