Titanium Appcelerator Quickie: iPad Popover and buttonBar - Clearly Innovative | Web and Mobile DevelopmentClearly Innovative | Web and Mobile Development

The popover is a standard UI element when writing iPad applications.

The popover usually appears when a user clicks a button and then is hidden or removed when the user selects an element in the popover or clicks outside the popover’s region.

ButtonBars are also a common UI element in iPhone and iPad development, when we use the two together with Titanium Appcelerator we run into some problems.

The way the popover is implemented, it attempts to render itself in the center of the view that is presented to it ( see line 46 ). The issue is if you do something like this

you will get the popover centered over the middle of the buttonBar control and not the specific buttonBar button that was clicked.

Now one would believe you could just get the button objects from the buttonBar and use the view from the specific button that was clicked as a reference, like so

the buttons are not available to you through the API… So you/I was forced to be creative.