Experience in application ivx for mobile end radio functions

Radio selectors are various cases are often used to a feature of today ivx method implemented in a single selector be a summary, we want to help.

1. The pull-down menu
A first method is to add a pull-down menu component, which is located to interact with the expansion assembly in the form class. After adding input options and the list of options separated (if data binding can be bound to a one-dimensional array) with a comma.
Here Insert Picture Description
Here Insert Picture Description
Or select the drop-down menu to open the Customize option, and then click to expand the component to add drop-down menu options, defined the content of each of the pull-down menu options.
Here Insert Picture Description
Finally, add an event to the drop-down menu, select an option when we drop down menu will in return give us a parameter is selected its current value.
Here Insert Picture Description
2. single phone selector
The second method is to use a single phone selector assembly. The phone is also expanding individual choice is an assembly of components located expand selector class.
Here Insert Picture Description
Similarly with the drop-down menu, you can type in the options list of options separated by commas, or a one-dimensional array data binding.
Here Insert Picture Description
It is noted that single selector itself is not displayed, the initial state is hidden. Here we give the text component to add an event, click on the text component to the selector display.
Here Insert Picture Description
When the selector to select an option, a single selector returns parameter - the currently selected value, we can assign the value we set a good variable.
Here Insert Picture Description
3. Create a loop
third is to use a loop to create, create a loop that takes an array as a data source, we first write data into one-dimensional array, and data binding. At this point you can put options are created out, the effect is shown.
Here Insert Picture Description
Next, we add an event to the next text component for the container, click on the text when the data assigned to the current text of a text variable we set a good - "selected content." In this way, every time cycle created under the options are only one option and "selected content" is the same. (If you do not set two or more options for the exact same name, it should not be so boring bar)
Here Insert Picture Description
The final step is to select the display options can be open to other options with distinction. Ternary expression used here, the current data is 11,22,33 each text component, and so on, "selected content" is a 11,22,33 and other options that we click on the text component before current data 1. Each text component will judge their current data and "selected content" 1 are equal, equal to the background color in blue # 5FA2DD, text color #FFFFFF, not equal to the background color displays empty, namely transparency, font color display gray # 999999.
Here Insert Picture Description
It summarizes the
implementation of these three is the most commonly used mobile terminal function of individual choice, and welcome to continue to add. On individual choice, the most important is the ability to display the list, and get the user the option selected, and then return, as long as this can be considered to meet it implements a single-selection function.

Guess you like

Origin blog.51cto.com/14556317/2481404