Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spinner dropdown list is jumping while scrolling

Why is my spinner jumping while scrolling? I'm simply doing following:

ArrayAdapter<String> adapter = new ArrayAdapter<String>(v.getContext(), layout, textViewId, new ArrayList<String>());
adapter.setDropDownViewResource(layoutDropdown);
adapter.addAll(<DATA>);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(listener);

As long as the dropdown is small, everything works fine but if it gets larger and scrollable, I see that it jumps around while scrolling. Why?

I'm not changing the selection or data while scrolling, so I'm surprised that this happens in such an easy setup. Any ideas how to solve this?

enter image description here

like image 370
prom85 Avatar asked Jan 18 '18 19:01

prom85


1 Answers

I was faced with this.

Problem is anroidx update libs

UPDATE: as Bill Bunting comment "alpha04" is ok now

Resolve by revert version appcompat from "alpha02/alpha03" up to "alpha04"

implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'

or better

implementation 'androidx.appcompat:appcompat:1.0.2' -> for more stable

like image 197
Hoa Nguyen Avatar answered Sep 28 '22 03:09

Hoa Nguyen