CheckBox is being clipped in tablet

406 Views Asked by At

I have this layout:

<LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
      android:layout_marginBottom="10dp"
      android:gravity="center_vertical" 
      android:layout_marginLeft="10dp">

      <CheckBox 
              android:id="@+id/screen_login_checkbox"
              android:button="@drawable/login_screen_checkbox_image_selector"
              android:layout_width="wrap_content"             
              android:layout_height="wrap_content"/>

      <TextView 
              android:layout_width="wrap_content"
              android:layout_marginLeft="10dp"
              android:text="@string/screen_login_checkboxLabel"
              android:layout_alignBaseline="@id/screen_login_checkbox"
              android:textColor="@color/black" 
              android:textSize="@dimen/screen_login_check_text"
              android:layout_height="wrap_content"/>
</LinearLayout>

The problem is that this works on smartphones but is not working properly on tablets. On tablets the CheckBox is getting clipped on the right side and I don't know why.

Does anyone know how to fix this?

1

There are 1 best solutions below

0
On BEST ANSWER

Try adding android:paddingRight to your CheckBox. It should work for tables and smallscreen aswell pretty well if you add padding using dp not px for padding values