0

I want to scroll my Spinner to specific position when user clicks on it. There are more than 50 items in it. That means I want to add initial position to almost top of the dropdown menu.

Tried this, doesnt work.

spinner?.setOnTouchListener { v, event ->
            v.scrollTo(v.scrollX, 0)
            v.performClick()
        }
martin1337
  • 2,384
  • 6
  • 38
  • 85

1 Answers1

0

Try to use setSelection.

Related: https://stackoverflow.com/a/10161277/1231245

StefMa
  • 3,344
  • 4
  • 27
  • 48
  • I dont want to select item in list, I want to scroll to specific position at start (without selecting option in Spinner header (or how to call it)) – martin1337 Aug 20 '19 at 09:54