iOSDropDown icon indicating copy to clipboard operation
iOSDropDown copied to clipboard

How to programatically set preselected Index?

Open JegaJegatheesh opened this issue 5 years ago • 1 comments

This is my code,

dropDown.selectedIndex = selectIndexAt

But didn't works

JegaJegatheesh avatar Jan 25 '20 12:01 JegaJegatheesh

Just saw this and running into the same issue I did this to solve it:

dropDown.selectedIndex = 0 dropDown.text = dropDown.optionArray[dropDown.selectedIndex!]

The actual index does get selected with "selectedIndex" but it does not display the text in the field, this way you also get the text placed in the field.

Hope this helps.

zzpaf avatar Nov 01 '22 08:11 zzpaf