2

I've created and laid out a UIView - everything looks fine, however while implementing a delegate method, I noticed a very odd frame orientation change.

The frame goes from: {{0, 0,} {1024, 768}} to {{0, 0}, {768, 1024}} <---- Flipped!

Update:

The problem only occurs when my view controller is presented (aka 'modally') from the current view controller. If the view controller is added directly to my UINavigationController, there's no issues.

So, when adding a new subview (a custom popover) via the delegate method, the layout goes haywire. But only if the view controller is being presented as follows:

- (void)presentPicker
{
    GTPPickerController* pickerViewController = [assembly pickerViewController];
    [pickerViewController setDelegate:self];
    [self presentViewController:pickerViewController animated:YES completion:nil];
}

Question:

  1. Is this a common known problem/mistake wrt 'modal' view controllers?
  2. How can I fix this?
  3. Could it be related to iOS7? I've done this kind of thing countless times before, and never had an issue.
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
  • Do your app support different orientations ? – Dinesh Kaushik Oct 28 '13 at 09:11
  • 1
    try breaking on setBounds or setTransform? – nielsbot Oct 28 '13 at 09:46
  • @DineshKaushik The supported interface orientations are the two landscapes. . and the view controller is instructed not to auto-rotate. – Jasper Blues Oct 28 '13 at 12:17
  • @nielsbot, Great suggestion, thanks. Nonetheless it wasn't helpful in this case :( – Jasper Blues Oct 28 '13 at 12:18
  • 1
    maybe you can post a minimal code that shows the issue? – nielsbot Oct 28 '13 at 17:37
  • if you're using auto layout perhaps the bounds of one of your superviews was changed instead? – nielsbot Oct 29 '13 at 00:55
  • @nielsbot - No auto-layout. These are code-based views, starting at CGRectZero, and then settling in as soon as layoutSubviews is called. . . I'm going to strip it down and post a simple project that reproduces the issue. . Meanwhile, I have enough info to work around the problem for now - instead of [self presentViewController I can slide up with my own animation. – Jasper Blues Oct 29 '13 at 01:51
  • 1
    probably reducing to miminal case will show where the issue lies. that's my last resort debugging strategy: reduce until the problem goes away. – nielsbot Oct 29 '13 at 05:39
  • Once I had a similar problem, then a I realized that apps on iPad are launched by default in portrait, You must insure that app is in landscape orientation. Check status bar orientation. Check this: http://stackoverflow.com/questions/5810397/status-bar-is-landscape-but-uiapplication-sharedapplication-statusbarorienta – Frade Jun 25 '14 at 15:41

0 Answers0