In my XML, I've set the focusable
, focusableInTouchMode
, clickable
, and longClickable
variables to false, yet I can still click and move the SeekBar. Do I need to actually change the listener events to do this? That seems so unnecessary.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
mySeekBar.setEnabled(false);
or for XML:
android:enabled="false"
回答2:
You could create a subclass whose parent is a SeekBar
. In your new class, override the onTouchEvent()
method to always return false.
This solution should not "grey out" the seek bar since the enabled state will not change.