mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

* Added textField, valueField and selectedValue properties textField and valueField - should be used with arrays of JSON objects textField - tells the listview which property should be used to display each item valueField - tells the listview, which property should be used to update the selectedValue selectedValue - is the property that will contain the selectedValue, if valueField is specified, then it will contain the value from that field, otherwise it will contain the whole selected item * Example showing textField, valueField and selectedValue in action * Update import paths
11 lines
372 B
XML
11 lines
372 B
XML
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
|
|
<StackLayout class="p-20">
|
|
<ListPicker items="{{ items }}"
|
|
textField="name"
|
|
valueField="role"
|
|
selectedIndex="2"
|
|
selectedValue="{{ selectedItem }}">
|
|
</ListPicker>
|
|
<Label text="{{ selectedItem }}" textWrap="true" />
|
|
</StackLayout>
|
|
</Page> |