2

我有两个搜索栏。当我移动拇指 2 时,我想在搜索栏一中看到进度。请帮忙,这可能吗?

  android:id="@+id/seekbarone"

  android:layout_width="fill_parent"

  android:layout_height="wrap_content"

  android:layout_marginTop="3dp"

  android:max="100"

  android:maxHeight="8dp"
  ...

  android:id="@+id/seekbartwo"

  android:layout_width="fill_parent"

  android:layout_height="wrap_content"

  android:layout_marginTop="3dp"

  android:max="100"

  android:maxHeight="8dp"
  ...
4

1 回答 1

3
SeekBar sb1 = (SeekBar) findViewById(R.id.seekbarone);
SeekBar sb2 = (SeekBar) findViewById(R.id.seekbartwo);
sb2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {


            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {


            }

            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {
                sb1.setProgress(progress);

            }
        });
于 2012-12-15T02:56:06.173 回答