[TIMOB-3073] Reopening a window creates duplicates scrollview
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T03:36:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M10 |
Components | Android |
Labels | android, defect, release-1.6.0 |
Reporter | pete |
Assignee | Don Thorp |
Created | 2011-04-15T03:36:06.000+0000 |
Updated | 2017-03-02T19:32:42.000+0000 |
Description
When I click to reopen a window I get multiple instances of that window. Either it is being opened twice the 2nd time or never really closed. Please see the example code for a better explanation.
The code below is a simplified version of my project to show the error.
app.js
var win1 = Titanium.UI.createWindow({
backgroundColor:'#000',
exitOnClose:true,
navBarHidden:true,
orientationModes: [Ti.UI.PORTRAIT],
zIndex:-1}
);
win1.open();
var body = Titanium.UI.createScrollView({
right:0,left:0,top:60,bottom:50,width:'auto',height:'auto'
});
var button = Titanium.UI.createButton({
title:'click to open',
top:190,
left:30,
height:50,
width:250,
font:{fontSize:20}
});
body.add(button);
win1.add(body);
button.addEventListener('click', function(){
win3.open();
});
var win3 = Titanium.UI.createWindow({
title: 'Window 3',
name: 'Window 3',
backgroundColor: '#C4D5DA',
fullscreen: false,
animate: ({opacity: 0,duration: 300 }),
url: 'win3.js'
});
win3.js
var win3 = Titanium.UI.currentWindow;
var body = Titanium.UI.createScrollView({
contentWidth:Titanium.Platform.displayCaps.platformWidth,contentHeight:500,
right:0,left:0,top:60,bottom:50,width:'auto',height:'auto',
showHorizontalScrollIndicator:false,showVerticalScrollIndicator:false});
win3.add(body)
var button = Titanium.UI.createButton({
title:'click to close',
top:190,
left:30,
height:50,
width:250,
font:{fontSize:20}
});
body.add(button);
button.addEventListener('click', function(){
win3.close();
});
Please use Q&A for support issues. You need to create the window in the button click handler and open it there.
Why is this invalid?
I have been trying to get help with this for 2 months now. If it is invalid, please tell me why and I will correct my code. My code works just fine with iPhone.
Closed as invalid.