0

I need to create a check box in my app. So for the same reason I have installed the native check box widget from the following link http://gitt.io/component/checkbox

After installation when I run my app, the result is as follows,

enter image description here

But I need to show the options for the check box. But i am not able to add the option label text for the check boxes. Can any one help me how to add the options text for check box.

I need the output similar to as follows,

enter image description here

Please help me how do do that. Or any other best alternatives.Please..

Vinod
  • 2,263
  • 9
  • 55
  • 104
  • Could you please provide some code? It is hard to figure out whats wrong if we dont know what you are doing. – Robin Ellerkmann Oct 21 '14 at 07:57
  • I have added a widget from the following link, https://github.com/jbeuckm/AlloyCheckbox I didn't modified any thing – Vinod Oct 21 '14 at 08:07
  • Try to add a label component to your program which is independent from the checkbox. – Robin Ellerkmann Oct 21 '14 at 08:12
  • Yes I have added the external label but it is not coming side to check box. It is coming below the check box ( Next line) But I need to use the property layout: 'vertical', So how can I adjust the label side to the check box – Vinod Oct 21 '14 at 08:18

1 Answers1

1

I guess what you need is a view element which contains the checkBox and the corresponding label. Like this:

<View id="yourOuterView" layout="vertical">
    <!-- other stuff -->
    <View id="checkBoxContainerView" layout="horizontal">
        <CheckBox />
        <Label id="yourLabel" />
    </View>
</View>

Please use your Checkbox code properly, I couldn't put it in because you did not provide any code. It is also possible to use an inner view without a layout by giving the checkBox and the label left/right attributes.

Robin Ellerkmann
  • 2,083
  • 4
  • 29
  • 34
  • I got one issue for same question. I have posted the question in following link, Please help me how to resolve the issue, http://stackoverflow.com/questions/26489145/issue-with-label-alignment-in-titanium-alloy – Vinod Oct 21 '14 at 14:29