Pickers

A Picker is a control for selecting custom items such as text, images or colors. The image below shows two Picker controls with customized content.


Screens showing a Picker that selects a color and a Picker that selects zodiac signs.

Picker controls support several different types, which are specified using the kind property. The default type is PickerKind::Default, which lets the OS determine the type for the control. The PickerKind::List and PickerKind::Expandable types are also supported.

The appearance of a Picker largely depends on its type and contents. Because the contents of a Picker are customized, the appearance can vary greatly.

Sizing

  • The width is manually adjustable using the minWidth, maxWidth, and preferredWidth properties.
  • The height of an expanded Picker varies based on the number of rows, and the device. An all-touch device displays up to five rows before scrolling, and a device with a physical keyboard displays up to three rows.
  • The height of a row is fixed and can't be changed.
  • The leftPadding, rightPadding, topPadding, and bottomPadding properties can't be used on this control.

Picker example

The Pickers documentation has a number of examples of how to implement pickers in your app.

For an example of how to implement a custom picker using C++ and QML, see Tutorial: Custom picker.

For an example of how to implement a custom picker using only QML, see Tutorial: Custom picker using QML.

Animation showing scrolling items in a custom picker.

Last modified: 2013-12-21



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus