程序中会使用到发短信功能,由于iOS的限制,导致只能调用系统短信发送,常用的方法是采用Apple提供的MFMessageComposeViewController来访问系统发短信界面,但是由于MFMessageComposeViewController会受到app内部navigationBar的干扰导致navigationBar也会跟着变色,但是因为右上角返回键初始颜色为蓝色,如果navigationBar颜色较深的话会导致看不见返回键,下面提供一种更改返回键颜色的方法:
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.navigationBar.tintColor = [UIColor blackColor];
if (numberString != nil) {
picker.recipients = [NSArray arrayWithObject:numberString];
}
picker.body = contentString;
[self presentModalViewController:picker animated:YES];
[[[[picker viewControllers] lastObject] navigationItem] setTitle:NSLocalizedString(@"MEETME_SETTING_INVITED_STRING", nil)];
网友评论