【发布时间】:2014-08-09 18:54:32
【问题描述】:
我的第一个视图嵌入在导航控制器中,我将其半透明属性设置为 NO。这给了我想要的纯绿色,状态栏是白色。但是,当我打开 MFMailComposeViewController 时,半透明属性设置回 YES 并且状态栏变回黑色。
如何去除半透明并将状态栏设置回白色?下面是我的代码。
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
[self.navigationController.navigationBar setTranslucent:NO];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 1) {
if (indexPath.row == 0) {
NSArray *toRecipents = [NSArray arrayWithObject:@"email goes here"];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc.navigationBar setTintColor:[UIColor whiteColor]];
[mc.navigationController.navigationBar setTranslucent:NO];
[mc setSubject:@"Inquiry"];
[mc setMessageBody:@"Hi, " isHTML:NO];
[mc setToRecipients:toRecipents];
[self presentViewController:mc animated:YES completion:NULL];
}
}
}
【问题讨论】:
标签: ios objective-c xcode uinavigationcontroller mfmailcomposeviewcontroller