2017-03-22 14 views
-1

クリスタルシークバーを水平スクロールに使用していますが、スクロールを無効にする必要があります...クリスタルセクバーの相対レイアウトがディセーブルモードの相対レイアウト内にあるので、crystalseekbarをスクロールしたくありませんディセーブルモードでのレイアウト。クリスタルシークバーの水平スクロールを無効にする方法

<RelativeLayout 
      android:id="@+id/adjust_card_layout" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/adjust_card_disable_background" 
      android:layout_below="@+id/card_layout" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:layout_marginTop="20dp" 
      android:paddingBottom="40dp" 
      android:paddingTop="40dp"> 


      <RelativeLayout 
       android:id="@+id/adjust_text_layout" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerHorizontal="true"> 

       <TextView 
        android:id="@+id/select_card_text" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/select_card" 
        android:layout_centerHorizontal="true" 
        android:textColor="@color/white" 
        android:textSize="15sp" 
        android:textStyle="bold" 
        android:visibility="visible"/> 

       <TextView 
        android:id="@+id/adjust_text" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Adjust values for" 
        android:textColor="@color/white" 
        android:textSize="15sp" 
        android:visibility="gone"/> 

       <TextView 
        android:id="@+id/shop_visit_name" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="First Shop" 
        android:textColor="@color/white" 
        android:textSize="15sp" 
        android:textStyle="bold" 
        android:layout_toRightOf="@+id/adjust_text" 
        android:visibility="gone" 
        android:layout_marginLeft="5dp"/> 

      </RelativeLayout> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:weightSum="2" 
       android:layout_below="@+id/adjust_text_layout" 
       android:layout_marginBottom="20dp"> 

       <RelativeLayout 
        android:layout_width="0dp" 
        android:layout_weight="1" 
        android:layout_height="wrap_content"> 


        <RelativeLayout 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:id="@+id/adjust_hours_layout" 
         android:layout_centerHorizontal="true"> 

         <TextView 
          android:id="@+id/adjustHours" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:text="Adjust Hours" 
          android:textAllCaps="true" 
          android:textColor="@color/white" 
          android:textSize="15sp" 
          android:paddingBottom="5dp" 
          android:layout_alignBottom="@+id/adjust_hours" 
          android:layout_marginLeft="20dp" 
          android:layout_marginStart="20dp"/> 


         <TextView 
          android:id="@+id/adjust_hours" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:text="0" 
          android:background="#A2B0BE" 
          android:paddingLeft="40dp" 
          android:paddingRight="40dp" 
          android:paddingTop="5dp" 
          android:paddingBottom="5dp" 
          android:textColor="@color/white" 
          android:textSize="20sp" 
          android:layout_marginRight="20dp" 
          android:layout_alignParentRight="true" 
          android:layout_marginTop="20dp"/> 

        </RelativeLayout> 

        <com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar 
         android:id="@+id/rangeSeekbar1" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_below="@+id/adjust_hours_layout" 
         android:layout_marginTop="30dp" 
         app:bar_color="@color/hours_back" 
         app:bar_highlight_color="@color/btn_back" 
         android:layout_marginLeft="20dp" 
         android:layout_marginRight="20dp" 
         app:left_thumb_color="@color/white" 
         app:left_thumb_color_pressed="@color/white" 
         app:corner_radius="05" 
         app:data_type="_integer" 
         /> 

        <TextView 
         android:id="@+id/textMin1" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="MIN" 
         android:layout_below="@id/rangeSeekbar1" 
         android:layout_marginTop="3dp" 
         android:layout_alignLeft="@+id/rangeSeekbar1" 
         android:layout_marginLeft="12dp" 
         android:textSize="13dp" 
         android:textColor="@color/white"/> 

        <TextView 
         android:id="@+id/textMax1" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="MAX" 
         android:layout_below="@id/rangeSeekbar1" 
         android:layout_marginTop="3dp" 
         android:textSize="13dp" 
         android:textColor="@color/white" 
         android:layout_alignRight="@+id/rangeSeekbar1" 
         android:layout_marginRight="12dp"/> 

       </RelativeLayout> 



       <RelativeLayout 
        android:layout_width="0dp" 
        android:layout_weight="1" 
        android:layout_height="wrap_content"> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:id="@+id/adjust_mr_layout" 
        android:layout_centerHorizontal="true"> 

        <TextView 
         android:id="@+id/adjustMr" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="Adjust Mr" 
         android:textAllCaps="true" 
         android:textColor="@color/white" 
         android:textSize="15sp" 
         android:layout_marginLeft="20dp" 
         android:layout_marginStart="20dp" 
         android:paddingBottom="5dp" 
         android:layout_alignBottom="@+id/adjust_mr"/> 


        <TextView 
         android:id="@+id/adjust_mr" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="0" 
         android:background="#A2B0BE" 
         android:paddingLeft="40dp" 
         android:paddingRight="40dp" 
         android:paddingTop="5dp" 
         android:paddingBottom="5dp" 
         android:textColor="@color/white" 
         android:textSize="20sp" 
         android:layout_marginRight="20dp" 
         android:layout_alignParentRight="true" 
         android:layout_marginTop="20dp"/> 

        </RelativeLayout> 

        <com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar 
         android:id="@+id/rangeSeekbar2" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_below="@+id/adjust_mr_layout" 
         android:layout_marginTop="30dp" 
         app:bar_color="#A2B0BE" 
         app:bar_highlight_color="@color/btn_back" 
         app:left_thumb_color="@color/white" 
         app:left_thumb_color_pressed="@color/white" 
         app:corner_radius="05" 
         android:layout_marginLeft="20dp" 
         android:layout_marginRight="20dp" 
         app:data_type="_integer" 

         /> 

        <TextView 
         android:id="@+id/textMin2" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="MIN" 
         android:layout_below="@id/rangeSeekbar2" 
         android:layout_marginTop="3dp" 
         android:layout_alignLeft="@+id/rangeSeekbar2" 
         android:textSize="13dp" 
         android:textColor="@color/white" 
         android:layout_marginLeft="12dp"/> 

        <TextView 
         android:id="@+id/textMax2" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="MAX" 
         android:layout_below="@id/rangeSeekbar2" 
         android:layout_marginTop="3dp" 
         android:textSize="13dp" 
         android:textColor="@color/white" 
         android:layout_alignRight="@+id/rangeSeekbar2" 
         android:layout_marginRight="12dp"/> 


       </RelativeLayout> 

      </LinearLayout> 

      </RelativeLayout> 
+1

も入力してください。 – Nizam

+0

@Nizam Parent相対レイアウトは無効になっています(グレーアウト)。クリックするかscrollをスクロールするとcrystalseekbarが表示されます。crystalseekbarも無効にしたいだけです。 – Hemanth

+0

親レイアウトの代わりにcrystalseekbar自体を無効にしてみましたか? – Nizam

答えて

0

親レイアウトを無効にすることは可能です。しかし、これは内部の子供を無効にすることはありません。シークバーを無効にするには、seekbar.setEnabled(false);

関連する問題