Thumb doesn't match up with progress (seekbar)

时光总嘲笑我的痴心妄想 提交于 2019-12-12 14:35:20

问题


I have a bug after loading my seek bars. The thumb doesn't match with the progress value. After clicking the first time on the progress bar, the thumb moves correctly. Is there any solution for this problem? Thanks for help!

Screenshot:


回答1:


Check that your thumb offset in not set

android:thumbOffset="-10dp"



回答2:


You haven't provided much in the way of detail.

I've found with Android 2.3 and earlier that if I modify the thumb within my code I then need the following sequence:

int progress = getProgress();
setProgress(0);
setProgress(progress);

Otherwise, the thumb will not be in the correct position. You have to call setProgress(0) first because calling set setProgress() with the current position doesn't execute any useful code.



来源:https://stackoverflow.com/questions/11520078/thumb-doesnt-match-up-with-progress-seekbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!