SeekBar的基础试用

参考:http://blog.csdn.net/qq_28057577/article/details/52225870


max:最大进度
progress:当前进度


surgeSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            @Override

            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {



            }



            @Override

            public void onStartTrackingTouch(SeekBar seekBar) {

                Toast.makeText(ChangeActivity.this,"slide to change surge",Toast.LENGTH_SHORT).show();

            }



            @Override

            public void onStopTrackingTouch(SeekBar seekBar) {

                Toast.makeText(ChangeActivity.this, "surge is"+surgeSeekBar.getProgress()*2+"%", Toast.LENGTH_SHORT).show();

            }

        });


onProgressChanges:进度改变时
onStartTrackingTouch:按住SeekBar时
onStopTrackingTouch:放开SeekBar时

你可能感兴趣的:(SeekBar的基础试用)