Skip to end of metadata
Go to start of metadata

Demonstrates how to use a PopOver control iPad devices to present temporary information.

Example App Source Location

Icon

You can find this example app in the Alloy repository under samples/apps/ui/popover. Check the instructions how to run these sample projects.

Popovers are used to present temporary information in a non-modal manner. The popover remains visible until the user taps outside of the popover window, or it is explicitly dismissed. The main index.xml view presents two buttons, "Popover" and "Popover with content view" that call the view-controller's openPopover() and openPopoverWithContentView(), respectively, when clicked.

app/views/index.xml

The popover.xml and popover_with_window.xml views each declare a <Popover> element that, in turn, contains a <ContentView> element. The <ContentView> element contains the actual content that is displayed by the popup.

app/views/popover.xml
app/views/popover_with_window.xml

When a button on the main view is clicked, the main view-controller gets a reference to a popover XML view, and calls its show() method, passing it a PopoverParams object whose view property that specifies the view to which the popover should be anchored.

app/controllers/index.js

See also

  • No labels