您好,欢迎访问四川文乐途图包装有限公司!

全国咨询热线

18980820575
✕

营山网站设计公司,营山网页设计,营山网站维护,营山网站优化,seo优化,,营山网站建设,营山网站公司

SeekBar拖动条的使用方法-创新互联

今天就跟大家聊聊有关SeekBar拖动条的使用方法,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

专业从事成都做网站、网站制作,高端网站制作设计,重庆小程序开发公司,网站推广的成都做网站的公司。优秀技术团队竭力真诚服务,采用H5场景定制+CSS3前端渲染技术,成都响应式网站建设公司,让网站在手机、平板、PC、微信下都能呈现。建站过程建立专项小组,与您实时在线互动,随时提供解决方案,畅聊想法和感受。

目标效果

在该页面中放一个拖动条的状态提示信息,一个拖动条以及一个显示拖动条值的信息。当我们点击拖动条时,在状态栏显示:正在拖动,并显示此时拖动条的值;当停止点击拖动条的时候,状态显示:停止拖动。

目标界面如下所示:

SeekBar拖动条的使用方法

SeekBar拖动条的使用方法

SeekBar拖动条的使用方法

页面布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/LinearLayout1"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity"
  android:background="@drawable/b1" >

  <TextView 
    android:id="@+id/status"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="我是当前拖动条的状态"
    android:textColor="#FFFFFF"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="20dp"
    android:textSize="24dp"/>

  <SeekBar
    android:id="@+id/seek"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="20dp" />

  <TextView 
    android:id="@+id/show_values"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="20dp"
    android:text="当前的值为0"
    android:textColor="#FFFFFF"
    android:textSize="24dp"/>
</LinearLayout>
友情链接 :