CheckBox interval is very different on two phones

I'm having trouble choosing the spacing between the checkboxes and the text associated with them.

My google galaxy nexus shows this:

screenshot 1

My galaxy s2 shows this:

screenshot 2

My layout is simple:

<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/transparent_content_box" android:layout_marginBottom="5dp" android:orientation="vertical" > <CheckBox android:id="@+id/edit_profile_private_wardrobe" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/edit_profile_wardrobe" style="@style/Theme.CheckBoxHint" /> <CheckBox android:id="@+id/edit_profile_send_me_vouchers" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/edit_profile_vouchers" style="@style/Theme.CheckBoxHint" /> <CheckBox android:id="@+id/edit_profile_third_party_email" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/edit_profile_email" style="@style/Theme.CheckBoxHint" /> </LinearLayout> 

Like my style:

 <style name="Theme.CheckBoxHint"> <item name="android:textSize">16sp</item> <item name="android:textColor">@color/white</item> </style> 

These flags are configured using the selected selector and set it using:

 <style name="Theme.CheckBox" parent="android:Widget.CompoundButton.CheckBox"> <item name="android:button">@drawable/check_box</item> </style> 

What is then used in the main theme of the application:

 <item name="android:checkboxStyle">@style/Theme.PMBAppTheme.CheckBox</item> 

I tried installing the add-on to 0 on the checkbox, but that just makes the text sit above the checkbox.

How to remove extra spacing around flags in galaxy s2?

+4
source share
2 answers

It turns out setting <item name="android:background">@null</item> in my Theme.CheckBoxHint solves my problem. A transparent element should be used as the background.

+1
source

You need to set the fields, not the gaskets. Make sure that Theme.CheckBoxHint fields are 0.

-2
source

All Articles