开发者

android seekbar drawing problem on orientation change

开发者 https://www.devze.com 2023-01-18 22:31 出处:网络
when the orientation changes, the seekbar drawing is messed up. See voice call and开发者_如何学C alarm below:

when the orientation changes, the seekbar drawing is messed up. See voice call and开发者_如何学C alarm below:

android seekbar drawing problem on orientation change


I think I figured it out. SeekBar.setSaveEnabled(false) seems to fix this.


I was having this issue myself, and saveEnabled="false" did not fix it. My problem was that I was calling setMax after setProgress:

mSeekBar = (SeekBar) findViewById(R.id.seekBarMediaDC);
mSeekBar.setProgress((int) currentItem.volumeDC);
mSeekBar.setMax(10);

And changing it to this fixed it:

mSeekBar = (SeekBar) findViewById(R.id.seekBarMediaDC);
mSeekBar.setMax(10);
mSeekBar.setProgress((int) currentItem.volumeDC);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号