27

Possible Duplicate:
How to show android checkbox at right side?

In my android application, I have a checkbox and some text associate with it. By default the texts are in the right side and the checkbox in left side. But I want to put the checkbox on the right side. Help me please.

Community
  • 1
  • 1
Shaiful
  • 5,643
  • 5
  • 38
  • 41

3 Answers3

39

Very easy. Do it in an elegant way:

  1. Create your own checkbox button. It includes a checked and unchecked state.
  2. Edit your layout file, for checkbox node:
    1. Set android:button="@null"
    2. Set android:drawableRight="@drawable/YOUR_CHECKBOX_BUTTON"

Perfectly solve your problem.

If you want to put the text under your button, set android:drawableTop.

tomrozb
  • 25,773
  • 31
  • 101
  • 122
Henry Sou
  • 882
  • 2
  • 12
  • 19
19

I dont know whether it is possible or not by styling ,

But here is a solution for you

Use "" as the value of the CheckBox ,then add a TextView to the left of the CheckBox with your desired text.

Tanmay Mandal
  • 39,873
  • 12
  • 51
  • 48
1

You can do so by:

  1. taking a linear layout.
  2. Put it's orientation to horizontal.
  3. Then put a text view and then a check box.
  4. Put the same text in the text view that you wanted to associate with the check box.

Thanks.

aurbano
  • 3,324
  • 1
  • 25
  • 39
N-JOY
  • 10,344
  • 7
  • 51
  • 69