android - Creating checkbox using titanium alloy -


i new in titanium alloy , change project titanium default template alloy. below code creating text box in default template. change alloy template.

    var checkbox = ti.ui.createswitch({    id:'checkbox',    style:ti.ui.android.switch_style_checkbox, }); 

not hard @ all! try inside alloy xml view markup:

checkbox.xml

<alloy>     <switch id="checkbox"/> </alloy> 

now can use style file set attributes based on id.

checkbox.tss

"#checkbox[platform=android]" : {     style:ti.ui.android.switch_style_checkbox } 

this set style checkbox, note set happen android. alternatively, if wanted every switch of checkbox style set inside app.tss:

"switch" : {     style:ti.ui.android.switch_style_checkbox } 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -