Can't create a modal window in 2.1.3

You must Login before you can answer or comment on any questions.

I opened a project from last year, and when compiled in 2.1.3GA I get this warning:

[WARN] Trying to open a new window from within a Modal Window is unsupported.

I had been opening a modal window at launch:

wIntro.open({
     modal : true,
     ipad_modal_presentation_style : "UIModalPresentationFormSheet",
     ipad_modal_transition_style : "UIModalTransitionStyleCoverVertical",
     navBarHidden : true
 });
 
wIntro.addEventListener('open', checkReminderToRate);
So, how am I supposed to do that now?


Titanium Studio, build: 2.1.2.201208301612, SDK 2.1.3GA, IOS6, Xcode 4.5, OS 10.8.2

1 Answer

By definition, you can't have more than one modal window open at a time.

— answered 8 months ago by Shannon Hicks
answer permalink
3 Comments
  • @Shannon, I'm not. At app launch, I am opening this window. It stays open until user clicks "OK" in it.

    Also, elsewhere in the app I am using a modal window to display help text. I get the warnings in the console for those too, but at least those work.

    NOTE: This app did not generate these warnings when I first made it, last year, and it is also in the app store. I am just making a 2.0 update to it.

    — commented 8 months ago by Steve Lombardi

  • My gut says that the error message is accurate. Check your application's root window, and I bet you'll find you're setting it to be modal also.

    — commented 8 months ago by Shannon Hicks

  • No, I'm not. The root window is created as part of a tab group:

    // create tab group
    var tabGroup = Titanium.UI.createTabGroup();
    var win1 = Titanium.UI.createWindow({
        title : 'Recipes',
        backgroundColor : '#fff',
        barColor : bc,
        url : 'recipes.js',
        orientationModes : [Titanium.UI.PORTRAIT]
    });
    var tab1 = Titanium.UI.createTab({
        icon : 'tab-recipes.png',
        title : 'Recipes',
        window : win1
    });
    then later I create wIntro like this var wIntro = Ti.UI.createWindow(); and open it with the above code.

    then i assign the other windows to tabs and open the tab group behind the modal wIntro.

    this seems to only be an issue with the more recent sdk, originally was done in 1.7.3 with no problem.

    — commented 8 months ago by Steve Lombardi

Your Answer

Think you can help? Login to answer this question!