Created
January 30, 2012 16:05
-
-
Save benbahrenburg/1705155 to your computer and use it in GitHub Desktop.
backgroundGradient Error
This file contains 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
//Setup our app namespace | |
var my={}; | |
//Bring in our helpers | |
my.helpers=require('helpers'); | |
//Bring in our custom UI elements | |
my.uiHelpers=require('ui_helper'); | |
//Bring in our fake modules | |
my.mod=require('some_mod'); | |
//Let's get a window | |
my.win=my.mod.fetchWindow(); | |
//Open the window | |
my.win.open(); |
This file contains 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.makeWindow=function(a){ | |
a = a || {}; | |
var win = Ti.UI.createWindow(a); | |
win.orientationModes = [ | |
Ti.UI.PORTRAIT, | |
Ti.UI.UPSIDE_PORTRAIT | |
]; | |
return win; | |
}; |
This file contains 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.fetchWindow=function(){ | |
//We make a window | |
var win = my.helpers.makeWindow(); | |
//We use a UI helper to get a Yellow view | |
//In the read world this would be a custom control | |
win.add(my.uiHelpers.uglyVw()) | |
//return the window | |
return win; | |
}; |
This file contains 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.uglyVw=function(){ | |
var uglyView = Ti.UI.createView({ | |
top:10, | |
height:150, | |
backgroundGradient:{ | |
type:'radial', | |
colors:[{color:'yellow',position:0},{color:'white',position:1}] | |
} | |
}); | |
//Show the error, not ment to be a good example of coding | |
uglyView.addEventListener('click', function(e) { | |
Ti.API.info('This would call an inner function or osmething'); | |
}); | |
return uglyView; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment