【问题标题】:Disable NavBar Translucency in MFMailComposeViewController在 MFMailComposeViewController 中禁用导航栏半透明
【发布时间】: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


    【解决方案1】:

    这对我有用:

    [[UINavigationBar appearance] setTranslucent:NO];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-16
      • 2014-08-19
      • 1970-01-01
      • 1970-01-01
      • 2015-03-29
      相关资源
      最近更新 更多