如何在Android中制作Double seekbar?

编程入门 行业动态 更新时间:2024-10-25 02:31:06
本文介绍了如何在Android中制作Double seekbar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在构建一个android应用程序,用户可以通过seekbar选择最大值.

I am building an android application where the user select the a maximum value by seekbar.

我需要在同一搜寻栏上另外一个按钮,以便用户可以从特定的唯一搜寻栏中选择最大值和最小值.

I need another button on the same seekbar so that user can select maximum and minimum value from a particular unique seekbar.

这是我的单搜寻条代码-

Here is my code of single seek bar -

package com.ui.yogeshblogspot; public class CustomSeekBarExActivity extends Activity implements OnSeekBarChangeListener{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); SeekBar bar=(SeekBar)findViewById(R.id.seekBar1); bar.setOnSeekBarChangeListener(this); } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { // TODO Auto-generated method stub TextView tv=(TextView)findViewById(R.id.textView2); tv.setText(Integer.toString(progress)+"%"); } @Override public void onStartTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } @Override public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } }

这是我的搜索栏的xml代码-

Here is my xml code of seek bar -

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="schemas.android/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#FFFFFF"> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Choose Your Progress" android:textColor="#000000" android:textAppearance="?android:attr/textAppearanceMedium" /> <SeekBar android:id="@+id/seekBar1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:progressDrawable="@xml/progress" android:max="100" android:thumb="@xml/thumb"/> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#000000" android:gravity="center" android:layout_gravity="center" android:paddingTop="10dp" android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout>

推荐答案

Android小部件类库只有一个滑块控件,seekbar只有一个拇指控件.在线进行了一些研究,发现了这个很酷的自定义小部件range-seek-bar.

The Android widget class library has only one slider control, seekbar with only one thumb control. Did some research online and found this cool custom widget, range-seek-bar.

您可以关注以下任何一项

you can followed any one of below

github/edmodo/range-bar

code.google/p/range-seek-酒吧/

github/Larpon/RangeSeekBar

更多推荐

如何在Android中制作Double seekbar?

本文发布于:2023-10-08 02:48:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471287.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Android   seekbar   Double

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!