目标C:MFMailComposeViewController中的粗体消息体

时间:2013-04-02 02:25:57

标签: ios objective-c mfmailcomposeviewcontroller

我有这段代码

NSString *messageBody = [NSString stringWithFormat:@"Name: %@\nCompany/Institution: %@\nAddress: %@\nCity: %@\nCountry: %@\nContact Number: %@\nE-Mail: %@\n \n \n Message: %@", rName.text, rCompany.text, rAddress.text, rCity.text, rCountry.text, rContactNumber.text, rEmail.text, rDescription.text];
    [tempMailCompose setMessageBody:messageBody isHTML:NO];

填写MFMailComposeViewController上的内容现在我要做的是将姓名,地址,城市,国家,联系电话,电子邮件和消息设为粗体。我做的是插入<strong>,但结果是错误的,它还会将<strong>显示为文字。

我如何加粗呢?

1 个答案:

答案 0 :(得分:2)

试试这个

NSString *messageBody = [NSString stringWithFormat:@"Name: <b>%@</b><br/>Company/Institution: <b>%@</b><br/>Address: <b>%@</b><br/>City: <b>%@</b><br/>Country: <b>%@</b><br/>Contact Number: <b>%@</b><br/>E-Mail: <b>%@</b><br/> <br/> <br/> Message: <b>%@</b>", rName.text, rCompany.text, rAddress.text, rCity.text, rCountry.text, rContactNumber.text, rEmail.text, rDescription.text];
[tempMailCompose setMessageBody:messageBody isHTML:YES];