0

Please help me to create a seek bar with thinner line. Here is the code

  <android.support.v7.widget.AppCompatSeekBar
        android:id="@+id/sb_zoom_size"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_marginStart="0dp"
        android:max="200"
        android:padding="15dp"
        android:progress="100"
        app:tickMark="@color/colorPrimary"
        app:tickMarkTint="@color/colorPrimary"
        app:tickMarkTintMode="multiply"
        android:progressTint="@android:color/darker_gray"/>

Thank you

Gopa
  • 143
  • 1
  • 2
  • 9

2 Answers2

1

You can change the size/thickness of your seek-bar just by using these two attributes of seekbar: android:minHeight="20dp" and android:maxHeight="20dp"

For example,in your case :

<android.support.v7.widget.AppCompatSeekBar
        android:id="@+id/sb_zoom_size"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_marginStart="0dp"
        android:max="200"
        android:maxHeight="20dp"
        android:minHeight="20dp"
        android:padding="15dp"
        android:progress="100"
        android:progressTint="@android:color/darker_gray"
        app:tickMark="@color/colorPrimary"
        app:tickMarkTint="@color/colorPrimary"
        app:tickMarkTintMode="multiply" />

If you need a more customizable SeekBar then you'll need to use drawable and you can check this post.

Miruna Radu
  • 392
  • 2
  • 12
0

You can use this attributes in AppCompatSeekBar

android:minHeight="2dip"
android:maxHeight="2dip"
Milad Bahmanabadi
  • 946
  • 11
  • 27