2017-06-20 41 views
0

在这里,我正在做的是,我想显示在RangeSeekBar(在所选范围之间)运行的seekbar。为此,我想将这两个搜索栏放在一个位置上。如何在一个地方放置两个SeeksBars?

我不知道该怎么做。我已经尝试了RelativeLayout和FrameLayout,但没有发生任何事情。

谢谢。

activity_play.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    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"> 


<SeekBar 
    android:id="@+id/pSeekBar" 
    android:layout_width="match_parent" 
    android:layout_height="37dp" /> 
    <ListView 
     android:id="@android:id/list" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1.0" /> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@android:drawable/screen_background_light" 
     android:orientation="vertical" 
     android:padding="10dip"> 

     <TextView 
      android:id="@+id/selectedfile" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:ellipsize="middle" 
      android:gravity="center_horizontal" 
      android:singleLine="true" 
      android:text="Not file selected" 
      android:textColor="@android:color/black" /> 

     <com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar 
      android:id="@+id/rangeSeekBar" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:max="100" 

      android:paddingBottom="10dip" 
      /> 


     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:background="@android:drawable/screen_background_light" 
      android:gravity="center" 
      android:orientation="horizontal"> 

      <EditText 
       android:id="@+id/MinEditText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <ImageButton 
       android:id="@+id/prev" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@android:drawable/ic_media_previous" /> 

      <ImageButton 
       android:id="@+id/play" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@android:drawable/ic_media_play" /> 

      <ImageButton 
       android:id="@+id/next" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@android:drawable/ic_media_next" /> 


      <EditText 
       android:id="@+id/MaxEdiText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 
     </LinearLayout> 
    </LinearLayout> 

</LinearLayout> 
+0

你有一个形象,会告诉我们你想要做什么?你的描述不是很清楚! – matrix

+0

我完全想要一个搜索栏上的三个拇指。其中最右侧和最左侧的拇指将用作范围,中间的拇指可以在这些范围之间移动。 –

回答

0

u可以使用这个库它很难自己编写

https://github.com/syedowaisali/crystal-range-seekbar

+0

我已经在使用这个。它只提供两个拇指。我想放置两个seekbars(SeekBar和RangeSeekBar)在一个地方(一个在另一个)。 –

+0

你应该编辑这个库来达到你的目标.u不能在其上放置另一个seekbar。 –

+0

如何?你能告诉我吗? –

相关问题