Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spinner popup dialog not adjusting its width on screen rotation

I am using a Spinner with android:spinnerMode="dropdown". I have also set android:configChanges="orientation|keyboardHidden|screenSize" to prevent my Activity to get recreated. when I am in Landscape mode and click on Spinner it pops below the Spinner and have the width same as Spinner button, now when I rotate the screen to portrait mode the Spinner button width get reduced according to the screen size but the pop up dialog does not reduce its width accordingly.

Portrait mode screen: enter image description here

LAndscape Mode Screen enter image description here

I thought of closing the pop up and reopen it on screen orientation but I didn't found any way to close the pop up dialog.

like image 865
Nishant Avatar asked Oct 05 '22 19:10

Nishant


1 Answers

On the onConfigurationChanged() method call to spinner.invalidate();

like image 74
Anis BEN NSIR Avatar answered Oct 11 '22 01:10

Anis BEN NSIR