Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

thumbOffset doesn't work

My app has a seekbar with custom thumbOffset. And it works incorrectly on some devices (e.g. my own Samsung Galaxy GIO Android 2.3.3)

(my app is built for Android 2.1 and I can't change it)

I've made a simple App with a seekbar and nothing else - thumbOffset still doesn't work on my phone (but works correctly on some other devices - see UPD):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
          a:orientation="vertical"
          a:layout_width="fill_parent"
          a:layout_height="fill_parent">

    <SeekBar a:id="@+id/lights_downwash_slider"
         a:layout_width="280dp"
         a:layout_height="wrap_content"
         a:layout_gravity="center_horizontal"
         a:layout_margin="5dp"
         a:thumbOffset="-15dp"
         a:maxHeight="20dp"
         a:minHeight="20dp"
         a:progress="0"/>
</LinearLayout>

Did anyone have the same problem and has the solution?

UPD: works correctly on Samsung Nexus (android 4.0.4), on emulator 2.3 and 4.0.3

doesn't work on emulator 2.1 and Samsung Galaxy Gio (2.3.3)

like image 904
leshka Avatar asked Apr 17 '12 13:04

leshka


1 Answers

I got a same problem. I solved this problem with equivalent API (setThumbOffset) at run-time. (not in design time with xml)

Refer to below equivalent API. http://developer.android.com/reference/android/widget/AbsSeekBar.html#setThumbOffset(int)

like image 72
likebebop Avatar answered Sep 20 '22 17:09

likebebop