[TIMOB-1578] iOS: Trying to remove a previously removed view from a scrollableView has unexpected results
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-07-25T16:49:17.000+0000 |
Affected Version/s | Release 1.5.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Thomas Huelbert |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:56:33.000+0000 |
Updated | 2012-07-26T22:22:27.000+0000 |
Description
Using the code below,
1.launch the app, tap "remove view 3"
2.note the view was removed, tap the button again
results:view 2 seems to have been removed as well as objects on
it.
var win = Titanium.UI.currentWindow
//create view to show var view1 =
Titanium.UI.createView({backgroundColor:'#123'});
var view2 = Titanium.UI.createView({backgroundColor:'#456'});
var view3 = Titanium.UI.createView({backgroundColor:'#789'});
//create scrollable to be populated by above var scrollView =
Titanium.UI.createScrollableView({
views:[view1,view2,view3],
showPagingControl:true
});
//buttons for test var b1 = Ti.UI.createButton({
height:40,
width:200,
title:'Remove View 3',
top:160
});
view1.add(b1);
var text1 = Ti.UI.createLabel({
text:"view 1",
width:"auto",
height:"auto",
top:10,
})
view1.add(text1)
var text = Ti.UI.createLabel({
text:"view 2",
width:"auto",
height:"auto",
top:10,
})
view2.add(text)
var text3 = Ti.UI.createLabel({
text:"view 3",
width:"auto",
height:"auto",
top:10,
})
view3.add(text3)
//remove view3 b1.addEventListener('click', function()
{
scrollView.removeView(view3);
});
win.add(scrollView);
formatting got hoopty above, trying again...
var win = Titanium.UI.currentWindow
var view1 = Titanium.UI.createView({backgroundColor:'#123'});
var view2 = Titanium.UI.createView({backgroundColor:'#456'});
var view3 = Titanium.UI.createView({backgroundColor:'#789'});
var scrollView = Titanium.UI.createScrollableView({
});
var b1 = Ti.UI.createButton({
});
view1.add(b1);
var b2 = Ti.UI.createButton({
});
view1.add(b2);
var text1 = Ti.UI.createLabel({
})
view1.add(text1)
var text = Ti.UI.createLabel({
})
view2.add(text)
var text3 = Ti.UI.createLabel({
})
view3.add(text3)
b1.addEventListener('click', function()
{
});
b2.addEventListener('click', function()
{
});
win.add(scrollView);
I have recoded this page to test the issue more fully and also to remove the syntax errors.
On Android emulator this code seems to work without issue, and certainly not the issue you have described.
Would you run this code in your environment to confirm that it is still and issue for you?
Unable to reproduce described behavior via any of the provided tests in SDK 2.2.0.f9e938d on iPhone Sim 5.1.