1

enter image description here

this image show the default implementation of check box in android.

In this image check box is centre to the text. I want it to the top. what should i do?

  • http://stackoverflow.com/questions/4037795/android-spacing-between-checkbox-and-text Try applying that to your needs – Jayp Aug 23 '11 at 16:58
  • this is somewhat different what i want. –  Aug 24 '11 at 06:14
  • Okay. Just wondered if you could apply that technique to set bottom or top padding. – Jayp Aug 24 '11 at 06:32

2 Answers2

3

I used Relative layout. In <TextView> i used the following code for top padding and my problem gets solved. :)

android:layout_marginTop="6dip"
1

Have a custom 9-patch checkbox button with the stretchable portion defined at the bottom.. so the actual checkbox will be at the top and the rest space will be filled with transparency

Ron
  • 24,175
  • 8
  • 56
  • 97
  • it is working. Only small problem is checkbox text's gravity changing with it too. – Gökhan Barış Aker Jul 25 '12 at 06:45
  • @GökhanBarışAker Dont set the gravity. Have a custom 9-patch checkbox button with the stretchable portion defined at the bottom..so the actual checkbox will be at the top and the rest space will be filled with transparency.. – Ron Jul 25 '12 at 07:17