MFMailComposeViewController查看闪烁问题

时间:2015-07-28 13:18:37

标签: ios swift mfmailcomposeviewcontroller

当我显示MFMailComposeViewController时,它会查看闪烁(首先进入导航栏,然后进入正确位置),首先看起来像#34; To"字段进入导航栏然后出来。我使用以下代码。
        self.resignFirstResponder()         self.mailPicker = MFMailComposeViewController()

    self.mailPicker!.setToRecipients(self.mailer)
    self.mailPicker!.setSubject("hello");
    self.mailPicker!.setMessageBody("message text", isHTML: false);
    self.mailPicker!.mailComposeDelegate = self;
    self.mailPicker!.delegate = self

    self.presentViewController(self.mailPicker!, animated: true, completion: nil)`

1 个答案:

答案 0 :(得分:0)

尝试将此添加到您的viewcontroller:

- (void)viewDidAppear:(BOOL)animated {
    [UINavigationBar appearance].translucent = NO;
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [UINavigationBar appearance].translucent = YES;
    [super viewWillDisappear:animated];
}