0

I try create a custom seekbar like this : https://i.stack.imgur.com/8B0Q8.png

But i encountered problem this problems : https://i.stack.imgur.com/rcQG7.png

I use this project for dynamically change text : github.com/Amit-Gupta26/AndroidCustomSeekBar

My layout code is here:

 <RelativeLayout
 android:id="@+id/layout_seekbar"
 android:layout_width="match_parent"
 android:layout_height="0dp"
 android:layout_weight="1"
 android:background="@drawable/seekbar_bg" >

 <SeekBar
     android:id="@+id/seekbar"
     style="@style/CustomSeekBar"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentLeft="false"
     android:layout_alignParentTop="false"
     android:layout_centerHorizontal="true"
     android:layout_centerVertical="true" />

I try many different methods. But i couldnt achieve stability on all screens. How can do this ?

2 Answers2

0

I think this post will help you:

Custom Seekbar

Also you need to use 9patch images

MSA
  • 2,502
  • 2
  • 22
  • 35
0

After looking at the problems you faced, I believe that your problem is NOT how to create a customized seekbar, but how to control thumb size and bar size each alone, like making the thimb much bigger without having to make the bar or the endings that big, I see that you must have a look here and here and here

Community
  • 1
  • 1
Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118