Titanium Community Questions & Answer Archive

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

Popover help

Hi All,

Really simple issue, but annoying. I have a window that has a rightNavButton on the navbar, that opens a Popover. When the Popover opens it adds a ScrollView within it.

The issue I have is that when I close the popover with a popover.hide() and reopen it again by using the same click method, it re-adds the same ScrollView again so I only see half of my view. If I do it again, I can't see the first view until I scroll to the right.

Any thoughts on how I can reuse the original scroll view, and get it to either kill the scrollview when I hide the popover or hide it.

Anyone have the same issue?

Code is below (note the table is on one of the scrollviews):

var scrollView = Titanium.UI.createScrollableView({
    views:[view1,view2]
});

selectNewsBtn.addEventListener('click', function()
{
    var popover = Ti.UI.iPad.createPopover({
        height:350,
        width:350,
        title: "Select News Source",
        rightNavButton:addBtn
    });

    popover.add(scrollView);
}

table.addEventListener('click', function(e)
{
    //do tablerow stuff here
        popover.hide();
}
— asked July 28th 2010 by Paul Pounder
  • hide
  • popover
  • scrollview
0 Comments

3 Answers

  • Create the popover outside the click event and show it only when you need.

    — answered July 28th 2010 by Dan Tamas
    permalink
    0 Comments
  • Cheers Tamas, will give that a try

    — answered July 28th 2010 by Paul Pounder
    permalink
    0 Comments
  • Sorry wrong post…

    — answered October 14th 2010 by Chris Schultz
    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.