3

I have a PreferenceActivity containing a custom seekbar that extends the Preference class and it works properly, however I can't seem to find out how to set the margins (or padding) to have the view look the same on 2.3.3-2.3.7 and 4.0+ (the versions our apps target).

Here is the layout I use for the view of the preference:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="5dp"
    android:paddingBottom="5dp">

That layout makes the view look good on anything 4.0 and above, but when ran on 2.3.3-2.3.7, the view seems to have extra padding to the left.

Is there a way to find out the proper left/right padding a custom Preference should have to look similar in appearance to other preference views, preferably without having to provide version-specific padding?

Thanks!

Eric Fortier
  • 760
  • 1
  • 7
  • 16

0 Answers0