8

Possible Duplicate:
Android SeekBar thumb gets clipped/cut off

I was doing a custom seekbar, following this tutorial: http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/

But when I put the seek thumb either at the begining or at the end of the bar, its edge gets cut, like this: http://s2.postimage.org/d9dqrrms/myseekbar.png

I've done exactly what the tutorial says (just changed the gradient color). What's wrong?

Community
  • 1
  • 1
Sergio
  • 640
  • 6
  • 23
  • Try this : http://www.anddev.org/seekbar_progressbar_customizing-t6083.html Maybe helpful for you. – Uttam Oct 07 '11 at 16:46
  • 1
    Wow, and I thought I had searched enough. Yes, seems duplicated, sorry. Now everything works fine with these SeekBar properties: android:thumbOffset="9px" android:paddingRight="9px" android:paddingLeft="9px". My thumb is 18px width, so I put 9px offset and padding. Thank you all for your help. – Sergio Oct 07 '11 at 18:54

2 Answers2

16

Have you tried setting the thumb offset for the thumb drawable?

android:thumbOffset="-1px"
Talon06
  • 1,756
  • 3
  • 27
  • 51
  • 5
    Yes! Thank you. The only problem is that now the blue background exceeds the thumb, like this http://s2.postimage.org/elxttllw/myseekbar2.png Is there something to do with that? Still, I'm happy its edges aren't cut anymore. – Sergio Oct 07 '11 at 18:19
6

Try changing the left and right padding for the seekbar instead of the thumb offset that should do what you want it to do.

android:paddingLeft="1px" 
android:paddingRight="1px"
Talon06
  • 1,756
  • 3
  • 27
  • 51