Skip to content

Instantly share code, notes, and snippets.

@kaybie
Created July 3, 2011 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaybie/1062247 to your computer and use it in GitHub Desktop.
Save kaybie/1062247 to your computer and use it in GitHub Desktop.
Transition error
Titanium.UI.setBackgroundColor('#000');
var win1 = Ti.UI.createWindow({
backgroundColor: 'white'
});
var btn1 = Ti.UI.createButton({
title: 'Goto 2 - without animation (no error)',
width:300,
height:100,
top:100
});
var btn2 = Ti.UI.createButton({
title: 'Goto 2 - with animation (with error)',
width:300,
height:100,
top:220
});
btn1.addEventListener('click', function(e){
var win2 = Ti.UI.createWindow({
backgroundColor: 'blue'
});
win2.open();
var btn3 = Ti.UI.createButton({
title: 'Go back',
width:300,
height:100
});
btn3.addEventListener('click', function(e){
win2.close();
});
win2.add(btn3);
});
btn2.addEventListener('click', function(e){
var win2 = Ti.UI.createWindow({
backgroundColor: 'blue'
});
win2.open({transition:Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT});
var btn3 = Ti.UI.createButton({
title: 'Go back',
width:300,
height:100
});
btn3.addEventListener('click', function(e){
win2.close();
});
win2.add(btn3);
});
win1.add(btn1);
win1.add(btn2);
win1.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment