0

I am working with android tablet's. which has now design issues in various version of android which is looking good in some version's and not looking good in some version's(xml layout designs).

i deployed my app in two different version(4.1.2 and 4.4.2) with same screen size 10 inch

But the result is not same since the design is somehow changed, Checkbox text is not aligned properly in 4.1.2 but 4.4.2 looks better as i expected..

What is the problem in my coding? i have attached the screenshot below and see the checkbox coding for the reference.

4.1.2

4.2.2

  <CheckBox
                    android:id="@+id/rememberme"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingBottom="10dp"
                    android:paddingLeft="20dp"
                    android:button="@drawable/checkboxstate"
                    android:layout_marginRight="50dp"
                    android:paddingTop="10dp"
                    android:text="Remember me "
                    android:textColor="#000000" />

Helps Appreciated.!

Brendon
  • 1,368
  • 1
  • 12
  • 28
  • are you using the devices of same model with different android version?? – elixir bash Oct 06 '14 at 12:00
  • if not then try using the attribute android:textSize= "15sp" [change the number as per your need but make sure you use SP] – elixir bash Oct 06 '14 at 12:02
  • no its different vendors.. but screen size is same..version is different.. that text size is not a problem, the padding space is not same for both the versions. @elixirbash – Brendon Oct 06 '14 at 12:10
  • see the Screen DPI value is different for both the screens. But that is controlled when you use 'dp'. But the text is not affected as it is not aware of the DPI values.If you try applying SP attibute then it is made aware of the DPI of the screen and hence it will adjust. I m not able to test here. Did you try adding android:TextSize and let me know what is the result – elixir bash Oct 06 '14 at 12:18

1 Answers1

1

Checkbox padding behaves differently before/after API 17. See this answer for a quick example of how to work around this. The same question contains more discussion of the underlying cause if you are interested.

Community
  • 1
  • 1
stkent
  • 19,772
  • 14
  • 85
  • 111