0

我有一个 SeekBar:

SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar1);

我在 xml 中有一个自定义的不确定可绘制集:

android:indeterminateDrawable="@drawable/progress_indeterminate_horizontal"

从代码

seekBar.setIndeterminate(true);

有效,但是当我想在按钮单击时将不确定设置为 true 时不起作用 - 搜索栏变黑。

 Button startIndeterminateMode = (Button) findViewById(R.id.startIndeterminateMode);
        startIndeterminateMode.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                seeekBar.setIndeterminate(true);

            }
        });
4

1 回答 1

0

I am not sure if seekbar supports indeterminate mode, You should rather have seekbar and Progressbar in a single layout and make them visible and GONE alternatively depending upon onClick

于 2012-12-18T15:15:05.557 回答