Vertical Seekbar setProgress not working

前端 未结 2 1899
说谎
说谎 2021-01-13 15:25

Seek is not progressing. All seekbar comes to zero but textView shows value properly..

choosePreset.setOnClickListener(new OnClickListener()
{
    @Override
         


        
相关标签:
2条回答
  • 2021-01-13 15:56

    I am facing some other problem. but the given statement works.

    Add updateThumb method in VerticalSeekbar class like

    public void updateThumb()
    {
         onSizeChanged(getWidth(), getHeight(), 0, 0);
    }
    

    And then call update thumb method after setting progress.

    seekBar.setProgress((int) progress);
    seekBar.updateThumb();
    
    0 讨论(0)
  • 2021-01-13 16:11

    This is actually better :

    @Override
    public void setProgress(int progress) {
        super.setProgress(progress);
        onSizeChanged(getWidth(), getHeight(), 0, 0);
    }
    

    Now setProgress() method should work fine.

    0 讨论(0)
提交回复
热议问题