-
-
Save rborn/a5db006fb160989459f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.mySwitch.addEventListener('change',function(e){ | |
Ti.API.info('Switch value: ' + $.mySwitch.value); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<Window> | |
<Switch id="mySwitch" module="ui"/> | |
</Window> | |
</Alloy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.createSwitch = function(args) { | |
if (OS_ANDROID) { | |
var RealSwitch = require("com.yydigital.realswitch"); | |
return RealSwitch.createRealSwitch(args); | |
} else { | |
return Ti.UI.createSwitch(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment