Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Trying to write a transparant popup window. Example works but my code doesn't

Hi,
I'm trying to write a popup window similar to the one in the kitchensink demo (Window Standalone Open Animation Fun).

The thing is, as long as I create the window directly in the eventhandler it works. But as soon as I give the window a "url" property to define its contents, the popup doens't appear.

The Code looks like this:

    var t = Titanium.UI.create2DMatrix();    
    t = t.scale(0);

    var defective = Ti.UI.createWindow({
        url:'config.js',
        backgroundColor:'#2463DE',    
        borderWidth:8,
        borderColor:'#999',
        height:400,
        width:300,
        borderRadius:10,
        opacity:0.92,
        transform:t
    });


    var works = Titanium.UI.createWindow({
        backgroundColor:'#2463DE',
        borderWidth:8,
        borderColor:'#999',
        height:400,
        width:300,
        borderRadius:10,
        opacity:0.92,
        transform:t
    });

Now, the "works" window pops up without problem. But the "defective" window doesn't. As you can see it is identical with the "works" one but it also has a "url" property for its contents.
It can't be the contents of "config.js". As a test, I left config.js completely empty with the same result.
What I found out so far was this:
If I leave out "transform:t" from the "defective" window, it will pop up. But without animation…

I don't understand why a window won't show up when the "url" property AND the "transform" property is set. Without the "url" property it will show up with animation OR without the "transform" property it will show up without animation.

Anybody knows why this is?

— asked October 10th 2010 by Stephan Olbertz
  • animation
  • iphone
  • mobile
  • popup
  • window
0 Comments

2 Answers

  • This is probably a bug. Weird things seems to happen with a few controls once you add the url property.

    You should submit this to the Appcelerator bug tracker.

    Cheers,
    Angus

    — answered October 10th 2010 by Angus Peart
    permalink
    0 Comments
  • Hmm, okay. I will do that. It sure is weird, though.
    For now I think I'll use the "createOptionDialog" to blend my options dialog in. I have only two, three Buttons that do stuff anyway.
    But if I had a complete Menue with a cutom background etc, it would be nice to use "real" windows for the options.

    It's just way more manageable to have all windows in their own .js files and just direct the createWindow method to it via the url property.

    — answered October 10th 2010 by Stephan Olbertz
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.