Spinner
Last Updated On 2021-07-16
Version 1MinSDK 7Tutorial Video
A spinner component that displays a pop-up with a list of elements. These elements can be set in the Designer or Blocks Editor by setting theElementsFromString
property to a string-separated concatenation (for example, choice 1, choice 2, choice 3) or by setting the Elements
property to a List in the Blocks editor. Spinners are created with the first item already selected. So selecting it does not generate an After Picking event. Consequently it's useful to make the first Spinner item be a non-choice like "Select from below...".
Properties
You can set the below properties in the UI part of the builder.
- ElementsFromString - it's a textArea value which is set to blank 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.
- 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.
- 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.
- Prompt - it's a string value which is set to blank by default.
- Selection - 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.
Elements
returns a list of text elements to be picked from.
ElementsFromString
Sets the Spinner list to the elements passed in the comma-separated string
Height
Specifies the vertical height of the Spinner, measured in pixels.
HeightPercent
Specifies the vertical height of the Spinner as a percentage of the height of the Screen.
MarginBottom
Property for MarginBottom
MarginLeft
Property for MarginLeft
MarginRight
Property for MarginRight
MarginTop
Property for MarginTop
PaddingBottom
Property for PaddingBottom
PaddingLeft
Property for PaddingLeft
PaddingRight
Property for PaddingRight
PaddingTop
Property for PaddingTop
Prompt
Text with the current title for the Spinner window
Selection
Returns the current selected item in the spinner
SelectionIndex
The index of the currently selected item, starting at 1. If no item is selected, the value will be 0.
Visible
Specifies whether the Spinner should be visible on the screen. Value is true if the Spinner is showing and false if hidden.
Width
Specifies the horizontal width of the Spinner, measured in pixels.
WidthPercent
Specifies the horizontal width of the Spinner as a percentage of the width of the Screen.
Methods
You can set the below method blocks in the blocks section of the builder.
DisplayDropdown
Displays the dropdown list for selection, same action as when the user clicks on the spinner.
Events
You can set the below event blocks in the blocks section of the builder.
AfterSelecting
Event called after the user selects an item from the dropdown list.