ListPicker

Last Updated On 2021-07-16

Version 9MinSDK 7Tutorial Video

A button that, when clicked on, displays a list of texts for the user to choose among. The texts can be specified through the Designer or Blocks Editor by setting the ElementsFromString property to their string-separated concatenation (for example, choice 1, choice 2, choice 3) or by setting the Elements property to a List in the Blocks editor.

Setting property ShowFilterBar to true, will make the list searchable. Other properties affect the appearance of the button (TextAlignment, BackgroundColor, etc.) and whether it can be clicked on (Enabled).


Properties

You can set the below properties in the UI part of the builder.

  • BackgroundColor - it's a color value which is set to &h00000000 by default.
  • CustomFontTypeFace - it's a asset value which is set to blank by default.
  • ElementsFromString - it's a textArea value which is set to blank by default.
  • Enabled - it's a boolean value which is set to true by default.
  • FontBold - it's a boolean value which is set to false by default.
  • FontItalic - it's a boolean value which is set to false by default.
  • FontSize - it's a non negative float value which is set to 14.0 by default.
  • FontTypeface - it's a typeface value which is set to 0 by default.
  • HeihMargin - it's a four value which is set to 0,0,0,0 by default.
  • HeihPadding - it's a four value which is set to 0,0,0,0 by default.
  • Image - it's a asset value which is set to blank by default.
  • ItemBackgroundColor - it's a color value which is set to &hff000000 by default.
  • ItemTextColor - it's a color value which is set to &hffffffff by default.
  • MarginBottom - it's a non negative float value which is set to 0 by default.
  • MarginLeft - it's a non negative float value which is set to 0 by default.
  • MarginRight - it's a non negative float value which is set to 0 by default.
  • MarginTop - it's a non negative float value which is set to 0 by default.
  • Opacity - it's a integer value which is set to 0 by default.
  • PaddingBottom - it's a non negative float value which is set to 0 by default.
  • PaddingLeft - it's a non negative float value which is set to 0 by default.
  • PaddingRight - it's a non negative float value which is set to 0 by default.
  • PaddingTop - it's a non negative float value which is set to 0 by default.
  • Selection - it's a string value which is set to blank by default.
  • Shape - it's a button shape value which is set to 0 by default.
  • ShowFeedback - it's a boolean value which is set to true by default.
  • ShowFilterBar - it's a boolean value which is set to false by default.
  • Text - it's a string value which is set to blank by default.
  • TextAlignment - it's a textalignment value which is set to 1 by default.
  • TextColor - it's a color value which is set to &h00000000 by default.
  • Title - it's a string value which is set to blank by default.
  • Visible - it's a visibility value which is set to true by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

BackgroundColor

Returns the button's background color


CustomFontTypeFace

Sets the custom font


Elements

Specifies the list of choices to display.


ElementsFromString

Set the list of choices from a string of comma-separated values.


Enabled

If set, user can tap ListPicker to cause action.


FontBold

If set, ListPicker text is displayed in bold.


FontItalic

If set, ListPicker text is displayed in italics.


FontSize

Point size for ListPicker text.


Height

Specifies the vertical height of the ListPicker, measured in pixels.


HeightPercent

Specifies the vertical height of the ListPicker as a percentage of the height of the Screen.


Image

Image to display on button.


ItemBackgroundColor

The background color of the ListPicker items.


ItemTextColor

The text color of the ListPicker items.


MarginBottom

Property for MarginBottom


MarginLeft

Property for MarginLeft


MarginRight

Property for MarginRight


MarginTop

Property for MarginTop


Opacity

Set opacity value between 1 to 10


PaddingBottom

Property for PaddingBottom


PaddingLeft

Property for PaddingLeft


PaddingRight

Property for PaddingRight


PaddingTop

Property for PaddingTop


Selection

The selected item. When directly changed by the programmer, the SelectionIndex property is also changed to the first item in the ListPicker with the given value. If the value does not appear, SelectionIndex will be set to 0.


SelectionIndex

The index of the currently selected item, starting at 1. If no item is selected, the value will be 0. If an attempt is made to set this to a number less than 1 or greater than the number of items in the ListPicker, SelectionIndex will be set to 0, and Selection will be set to the empty text.


ShowFeedback

Specifies if a visual feedback should be shown for a ListPicker that has an image as background.


ShowFilterBar

Returns current state of ShowFilterBar indicating if Search Filter Bar will be displayed on ListPicker or not


Text

Text to display on ListPicker.


TextColor

Color for button text.


Title

Optional title displayed at the top of the list of choices.


Visible

Specifies whether the ListPicker should be visible on the screen. Value is true if the ListPicker is showing and false if hidden.


Width

Specifies the horizontal width of the ListPicker, measured in pixels.


WidthPercent

Specifies the horizontal width of the ListPicker as a percentage of the width of the Screen.



Methods

You can set the below method blocks in the blocks section of the builder.

Open

Opens the ListPicker, as though the user clicked on it.

PerformClick

Method for PerformClick


Events

You can set the below event blocks in the blocks section of the builder.

AfterPicking

Event to be raised after the `ListPicker` activity returns its result and the properties have been filled in.

BeforePicking

Event to raise when the `ListPicker` is clicked or the picker is shown using the

GotFocus

Indicates the cursor moved over the ListPicker so it is now possible to click it.

LostFocus

Indicates the cursor moved away from the ListPicker so it is now no longer possible to click it.

TouchDown

Indicates that the ListPicker was pressed down.

TouchUp

Indicates that the ListPicker has been released.