拖动条SeekBar

复制代码
 1 TextView tv=(TextView)findViewById(R.id.TV);
 2 tv.setMovementMethod(ScrollingMovementMethod.getInstance());//滚动文本
 3 SeekBar sb=(SeekBar)findViewById(R.id.seekbar);
 4 sb.setOnSeekBarChangeListener(
 5         new OnSeekBarChangeListener() {    //设置操作监听
 6     public void onProgressChanged(SeekBar seekBar, int progress,
 7                  boolean fromUser) {
 8         tv.setText("当前进度"+progress);
 9      }
10      public void onStartTrackingTouch(SeekBar seekBar) {
11          tv.setText("正在拖动,当前值"+seekBar.getProgress());
12      }
13      public void onStopTrackingTouch(SeekBar seekBar) {
14          tv.setText("停止拖动,当前值"+seekBar.getProgress());
15      }
16 });
复制代码

posted @ 2017-05-27 13:16  锦绣河山锦  阅读(92)  评论(0编辑  收藏  举报