Modal UIViewComponent orientation issue


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];

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.

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.






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]

I have the same problem with our port of

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

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?

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:



Hello, Can you please let me know how to build it in juce? i wan to display ActionSheet for iOS and Android. Can you please share the code here? I am new in Juce