Android如何暂时禁用Seekbar?

Android如何暂时禁用Seekbar?,android,android-layout,android-seekbar,Android,Android Layout,Android Seekbar,有没有办法暂时禁用Seekbar? 我尝试了setEnabledfalse和setClickablefalse。它不起作用。帮助我。 提前谢谢 <com.devadvance.circularseekbar.CircularSeekBar android:id="@+id/circularSeekBar1" android:layout_width="fill_parent" android:layout_height="wrap_conte

有没有办法暂时禁用Seekbar? 我尝试了setEnabledfalse和setClickablefalse。它不起作用。帮助我。 提前谢谢

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);
XML代码:

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);

我找到了暂时禁用seekbar的答案

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);
在Xml中,只需创建一个可视性为“消失”的布局

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);
<LinearLayout
                        android:id="@+id/Mainlayout"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent">
     <LinearLayout
                        android:id="@+id/seekbarblocklayout"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:orientation="vertical"
                        android:clickable="true"
                        android:visibility="gone"
                        />
    <com.devadvance.circularseekbar.CircularSeekBar
            android:id="@+id/circularSeekBar1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
    ....
    ....
    />

</LinearLayout>

我找到了暂时禁用seekbar的答案

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);
在Xml中,只需创建一个可视性为“消失”的布局

<com.devadvance.circularseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:lock_enabled="true"
        app:pointer_halo_color_ontouch="#ffd180"
        app:start_angle="150"
        app:end_angle="30"
        app:circle_x_radius="150"
        app:circle_y_radius="140"
        app:use_custom_radii="true"
        app:max="10"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#ffd180"
        app:circle_stroke_width="3"
        app:pointer_halo_color="#ffd180"
        android:layout_marginLeft="18dp"
        android:layout_marginTop="12dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="-25dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />
CircularSeekBar seekbar = (CircularSeekBar) findViewById(R.id.circularSeekBar1);
    seekbar.setAlpha(0.45f);
    seekbar.setEnabled(false);
<LinearLayout
                        android:id="@+id/Mainlayout"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent">
     <LinearLayout
                        android:id="@+id/seekbarblocklayout"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:orientation="vertical"
                        android:clickable="true"
                        android:visibility="gone"
                        />
    <com.devadvance.circularseekbar.CircularSeekBar
            android:id="@+id/circularSeekBar1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
    ....
    ....
    />

</LinearLayout>

发布您的代码,setEnabledfalse;应该工作。发布您的代码…………或检查此链接CircularsekBar seekbar=CircularsekBar findViewByIdR.id.CircularsekBar1;seekbar.setAlpha0.45f;请参阅kbar.setEnabledfalse;seekbar.setlockabledtrue;请看上面。我编辑了我的问题。@SumighoshCharuvil@zapI刚刚检查了github项目代码,发现它是通过扩展视图类创建的,没有可用的setenable或setclickable方法。但就目前的观点而言,我建议尝试将setfocusable和setFocusableInTouchMode设置为false,并可能会发布您的代码setEnabledfalse;应该工作。发布您的代码…………或检查此链接CircularsekBar seekbar=CircularsekBar findViewByIdR.id.CircularsekBar1;seekbar.setAlpha0.45f;请参阅kbar.setEnabledfalse;seekbar.setlockabledtrue;请看上面。我编辑了我的问题。@SumighoshCharuvil@zapI刚刚检查了github项目代码,发现它是通过扩展视图类创建的,没有可用的setenable或setclickable方法。但就目前的观点而言,我建议尝试将setfocusable和setFocusableInTouchMode设置为false,这样可能会起作用