문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top