How can I disable the seek bar for audio controller
-
26-09-2019 - |
문제
I'm currently using the following seekbar for showing my audio palying progress, i want to disable thumb movement by user.
<Seekbar
android:padding="7dp"
android:id="@+id/SeekBar01"
android:layout_width="245dip"
android:thumb="@drawable/seekthumb2"
android:progressDrawable="@drawable/seekbar1"
android:layout_height="fill_parent"
android:clickable="false"
android:focusable="false"
android:longClickable="false" />
But it's not working.
해결책
Try adding
android:enabled="false"
다른 팁
You can use android:enabled="false"
as suggested by @yuku, 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;
}
});
You can also use a transparent png as a thumb. If none of the suggested solutions work.
제휴하지 않습니다 StackOverflow