Titanium Community Questions & Answer Archive

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

iPad popoverView - any examples?

I am finding it a bit hard to locate a good example for the popover. The Kitchen Sink version is openPhotoGallery specific - so it's not useful for the the basic API version.

If someone has some working code to share that'd be cool.

— asked May 10th 2010 by Dan Newman
  • ipad
  • popoverview
0 Comments

1 Answer

  • Accepted Answer

    Hey Dan,

    This is pretty but hopefully will help a bit (I used this as app.js):

    //
    // create base UI tab and root window
    //
    var win1 = Titanium.UI.createWindow({  
        title:'Tab 1',
        backgroundColor:'#fff'
    });
    
    var label1 = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 1',
        font:{fontSize:20,fontFamily:'Helvetica Neue'},
        textAlign:'center',
        width:'auto'
    });
    
    var b1 = Titanium.UI.createButton({
        title:'View popover',
        height:40,
        width:200,
        top:400
    });
    
    win1.add(label1);
    win1.add(b1);
    
    var view_p = Ti.UI.createView({
        backgroundColor:'#fff',
        borderColor:'#363636',
        borderWidth:2,
        width:300,
        height:100
    });
    
    var label_p = Titanium.UI.createLabel({
        color:'#999',
        text:'I am Window 2',
        textAlign:'center',
        width:'auto'
    });
    
    view_p.add(label_p);
    
    b1.addEventListener('click', function()
    {
        var popover = Ti.UI.iPad.createPopover({height:100,width:300});
        popover.add(view_p);
        popover.show({view:b1});
    });
    
    
    win1.open();
    

    or maybe this:

    http://github.com/appcelerator/titanium_mobile/raw/master/demos/KitchenSink-iPad/Resources/popover.js

    — answered May 10th 2010 by Dan Giulvezan
    permalink
    1 Comment
    • Great! An actual working example – thank you! Sure would be nice to have something like this in the Kitchen Sink . . .

      — commented July 28th 2011 by Mark Pemburn
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.