Modal UIViewComponent orientation issue


#1

Hello,

I'am trying to integrate a Modal UiViewControler within juce (v2.1.6) application on iOs. (iPad) (SDK 7)

I first retrived the main UiViewController and added my UIViewController to it.

UIResponder* responder = ((UIView*) Desktop::getInstance().getComponent (0)->getWindowHandle()).nextResponder;
  
if ([responder isKindOfClass: [UIViewController class]])

  {
    UIViewController* controller = (UIViewController*) responder;

    [controller presentModalViewController:myUIViewController animated:YES]; // << HERE
  }

My problem is that when the iPad is not oriented in Portrait when the modal view is created, the Modal view seems to be generated out of the screen.

When the modal view is created in Portrait, everything is displayed properly, however, when I rotate the ipad the modal view does not follow the rotation as it should..

I tried to modify my code a little bit to figure out if the issue comes from the fact that my UiViewControler is Modal:
(This code is placed in a UiViewComponent)

UIResponder* responder = ((UIView*) Desktop::getInstance().getComponent (0)->getWindowHandle()).nextResponder; 

  if ([responder isKindOfClass: [UIViewController class]])
  {
    UIViewController* controller = (UIViewController*) responder;

    [ controller addChildViewController:myUIViewController];
    setView(myUIViewController.view);
  }

This code is working with the rotation, but unfortunately the UiViewControler I am intergrating (myUIViewComponent) is generating itself modal UiViewControlers that suffers of the same rotation issue.

Is anybody ran into that problem before ?
Thanks for your help.
 


#2

I have the same exact issue with modal views.

Here I want to add a MFMailComposeViewController view inside a UIViewComponent to display it in fullscreen, it's working correctly, but the action sheet "delete draft/save draft/cancel" inside the Mail Composer window ends up completely messed up on iPhone (while it's working correctly on iPad); it seems to be related to an orientation problem within the view.

 

 

expected:

 

 

Btw, the XCode debugger shows this message:

Presenting action sheet clipped by its superview. Some controls might not respond to touches. On iPhone, try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolBar:] instead of -[UIActionSheet showInView]


#3

I have the same problem with our port of https://github.com/jacobsologub/ext-juce-modules/issues/3

If the ipad is in landscape mode, the camera roll view controller does not rotate.


#4

As I am currently struggling with the same problem, I will just start by asking if anyone of you found a solution for this problem yet?


#5

After fighting this for a bit,  the answer is that UIImagePickerController only supports Portrait.  It would be nifty if the juce_ios_ImagePicker project were modified to use ECLImagePickerController project that creates its own UI using AssetLibrary items:

 

https://github.com/B-Sides/ELCImagePickerController

 

-Steve