Disable changes on seekbar by client

早过忘川 提交于 2019-11-27 22:02:52
Arjun Vekariya

One thing you can do is to disable the seekbar, Like seekbar.setEnabled(false)

doing so framework will not accept any Touch event from user and you Can change progress level only through code.

I hope this will help you.......

You can use android:enabled="false" , but it will display disable effect [darken your seekbar].

So if you want to display enable seekbar with no response to thumb activity, implement touch event handler with return true as shown below.

seekBar.setOnTouchListener(new OnTouchListener(){
  @Override
  public boolean onTouch(View v, MotionEvent event) {
    return true;
 }
});

Just return false from onTouch method of CustomSeekBar class.

Hope this works !

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