Class: Toybox.WatchUi.Picker
- Inherits:
-
Toybox.WatchUi.View
Overview
A representation of an on-screen generic picker.
A Picker consists of one or more choose-able objects, a title, a next and previous arrow, and a confirmation button. The next and previous arrows and the confirmation button are device specific but can be overridden if desired. A Picker is pushed using pushView(), which provides a PickerDelegate.
A PickerFactory is required to indicate what should be displayed for each pick-able value, and is capable of displaying any number of entries from which may be chosen. For example, consider the following:
new NumberFactory(); new Ui.Text({:text=>"-"}); new NumberFactory();
This Picker will have three entries: a choosable number, a non-choosable "-", and another choosable number.
See Also:
See the Picker sample distributed with the SDK for an example of the use of the Picker class
The look and feel of a Picker is device-specific, though every device will have the same general layout.
Typedef Summary collapse
- Options as { :title as WatchUi.Drawable, :pattern as Lang.Array<WatchUi.Drawable or WatchUi.PickerFactory>, :defaults as Lang.Array<Lang.Number>, :nextArrow as WatchUi.Drawable, :previousArrow as WatchUi.Drawable, :confirm as WatchUi.Drawable }
Instance Method Summary collapse
-
initialize(options as Picker.Options)
Constructor.
-
setOptions(options as Picker.Options) as Void
Set the options for the Picker.
Instance Method Details
initialize(options as Picker.Options)
Constructor
setOptions(options as Picker.Options) as Void
Set the options for the Picker.