Created
July 3, 2011 14:00
-
-
Save kaybie/1062247 to your computer and use it in GitHub Desktop.
Transition 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
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