Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've resolved the issue. First of all, I should say that my VC is always rotated to portrait after MailComposeVC is dismissed regardless of the current device orientation and its state before showing a mail... And the only VC method that gets called during auto rotation when MailComposeVC is on screen is <code>viewWillLayoutSubviews/viewDidLayoutSubviews</code>. (<code>willAnimateRotationToInterfaceOrientation</code> is not called!) So, I reset the navigation bar to recover its height and call my custom layout method if my VC is invisible, like that:</p> <pre><code>(void) viewDidLayoutSubviews { // HACK: forcing the bars to refresh themselves - this helps to get the shorter version when switching to landscape and the taller one when going back!!! if (amIhidden) { [self.navigationController setNavigationBarHidden:YES animated:NO]; [self.navigationController setNavigationBarHidden:NO animated:NO]; UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation]; [self layoutForInterfaceOrientation:currentOrientation]; } } </code></pre> <p><code>amIhidden BOOL</code> is set when presenting MailComposeViewController, as following:</p> <pre><code>UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[self] applicationActivities:nil]; amIhidden = YES; [activityViewController setCompletionHandler:^(NSString *activityType, BOOL completed){ amIhidden = NO; }]; [self presentViewController:activityViewController animated:YES completion:nil]; </code></pre> <p>Hope, my solution will help to somebody else!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload