Android SeekBar的使用

转载自:http://aina-hk55hk.iteye.com/blog/677254

    <?xml version="1.0" encoding="utf-8"?>      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"          android:orientation="vertical" android:layout_width="fill_parent"          android:layout_height="fill_parent">          <SeekBar android:id="@+id/SeekBar01" android:layout_width="fill_parent"              android:layout_height="wrap_content" android:max="100"              android:progress="50" android:secondaryProgress="100"></SeekBar>          <TextView android:id="@+id/TextView1" android:layout_width="fill_parent"              android:layout_height="wrap_content" android:text="" />          <TextView android:id="@+id/TextView2" android:layout_width="fill_parent"              android:layout_height="wrap_content" android:text="" />      </LinearLayout>  
    package com.Aina.Android;            import android.app.Activity;      import android.os.Bundle;      import android.widget.SeekBar;      import android.widget.TextView;            public class Test_SeekBar extends Activity implements SeekBar.OnSeekBarChangeListener{          /** Called when the activity is first created. */          private SeekBar seekBar;          private TextView textView1,textView2;          @Override          public void onCreate(Bundle savedInstanceState) {              super.onCreate(savedInstanceState);              setContentView(R.layout.main);              seekBar = (SeekBar) this.findViewById(R.id.SeekBar01);              textView1 = (TextView) this.findViewById(R.id.TextView1);              textView2 = (TextView) this.findViewById(R.id.TextView2);              seekBar.setOnSeekBarChangeListener(this);//添加事件监听          }          //拖动中          @Override          public void onProgressChanged(SeekBar seekBar, int progress,                  boolean fromUser) {              this.textView1.setText("当前值:"+progress);                        }          //开始拖动          @Override          public void onStartTrackingTouch(SeekBar seekBar) {              this.textView2.setText("拖动中...");                        }          //结束拖动          @Override          public void onStopTrackingTouch(SeekBar seekBar) {              this.textView2.setText("拖动完毕");                        }      }  

更多相关文章

  1. Android 两个可拖动的SeekBar 两点拖动
  2. Android 开发技巧之 手动拖动滚动条快速滑动
  3. Android——导入已存在的android工程时出现红叉错误“AndroidMan
  4. android的大好时光结束进行时
  5. 【Android】Android控件之Seekbar拖动条的使用
  6. Android ListView 去除边缘阴影、选中色、拖动背景色等
  7. android手动拖动滚动条快速滑动
  8. c语句以句号结束对吗

随机推荐

  1. Hyperledger Fabric 超级账本视频教程免
  2. 大龄程序员的出路在何方?
  3. css选择器优先级、伪类选择器的使用和模
  4. powershell 远程安装MSI文件
  5. vscode的使用配置以及markdown常用语法
  6. 2021年3月春招百度,阿里,美团等大厂全新PHP
  7. 在vscode中go编码发生的问题整理
  8. HTML的必考知识点你会吗?
  9. 如何用Github轻松拉取谷歌容器镜像
  10. 面试必备的Java面试题及毕设项目