Forging-Titanium
Forging-Titanium copied to clipboard
ep-002 crashes on android. TestWindow.js line 3 and line 15.
Hi, the demo crashes, because there is an error
line 3 controller is not found. i quess it should be the navController.
line 15 TestWindow is not found... well to solve this you can give the declaration function a name like Like Window and constuct it, using new window.
exports.TestWindow = function Window(navController) { //named function Window
var win = Ti.UI.createWindow({
title:'Window '+navController.windowStack.length, //used the param instead of global
backgroundColor:'#fff',
layout:'vertical'
});
var add = Ti.UI.createButton({
title:'Add A New Window',
height:'50dp',
width:'200dp',
top:'20dp'
});
add.addEventListener('click', function() {
navController.open(new Window(navController)); //call named constructor
});
.....
Now it works fine on Android and iOS.
Regards Aleksejs Okolovskis
+1 This fixed the demo for me.