How to change checkbox orientation

103 views
Skip to first unread message

asu

unread,
Mar 9, 2016, 7:17:10 AM3/9/16
to DroidScript
Hello,

I have not found a way to change the orientation of a checkbox control.

Checkbox Control:
Assume we have a fixed app orientation "Portrait"  but would like to havea checkbox text displayed in on screen horizontaly and  another checkbox rotated by 90 degrees (vertical text).


I have setup the screen with several layouts. The Layout.SetOrientation method had no effect on text orientation forsingle layouts.

Any ideas?

Thanks
Asu



Steve Garman

unread,
Mar 9, 2016, 9:11:23 PM3/9/16
to DroidScript
I don't think there is any way to do that in DroidScript with a checkbox control.

It sounds like it would be quite difficult to fake too.

asu

unread,
Mar 10, 2016, 5:57:21 AM3/10/16
to DroidScript
Thanks for your response Steve!

The only way I see to fake this is using a image control, draw both the checkbox square and text. Then by rotating the image 90° we have it turned. But the positioning is tricky...

What ist he Layout.SetOrientation (not app.SetOrientation) used for? I am not able to make sense of it.

Chris Hopkin

unread,
Mar 10, 2016, 10:41:46 AM3/10/16
to DroidScript
Layout.SetOrientation sets whether the child controls of a Linear Layout are stacked horizontally or vertically (accepts either "Horizontal" or "Vertical"). You'd normally set this as an option when you create the layout.

You could always use a CheckBox control with an empty label, then you just need to create the rotated label using an image, which you can add above/below the CheckBox (unless you wanted the CheckBox tick to be rotated too?).

asu

unread,
Mar 10, 2016, 1:21:33 PM3/10/16
to DroidScript
Thanks!


BareK

unread,
May 26, 2016, 2:44:54 PM5/26/16
to DroidScript
Hi all,

I know this thread is a bit old, but you can rotate the CheckBox tick too with the image tip given by Chris.
Simply replace the whole checkBox by an image using fontAwesome:
Also look at the "Icon Fonts" sample for a fontAwesome checkbox example.

Cheers :)
Reply all
Reply to author
Forward
0 new messages