[TIMOB-11527] iOS: View: Removing a view from ScrollView leaves a black view at first position
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-10-22T20:11:27.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | qe-ios100112 |
Reporter | Shyam Bhadauria |
Assignee | Vishal Duggal |
Created | 2012-10-18T10:08:17.000+0000 |
Updated | 2017-03-17T18:05:00.000+0000 |
Description
This is not a regression. It occurs since 2.1.1.
Steps to reproduce
1. Copy the code below in app.js and run the app
var win = Ti.UI.createWindow();
win.backgroundColor= 'white';
var scrollView = Ti.UI.createScrollView({
contentHeight:'auto',
contentWidth:0,
layout:'horizontal',
backgroundColor: 'green'
});
win.add(scrollView);
var colors = ['red', 'blue', 'pink', 'white', 'black'];
var max = 120;
for(var i = 0; i < max; i++){
var view = Ti.UI.createView({
backgroundColor: colors[i%colors.length],
borderColor:'gray',
borderWidth:4,
height: 100,
left: 10,
width: 100,
top: 10
});
view.addEventListener('click', function(_event){
scrollView.remove(_event.source);
});
scrollView.add(view);
}
win.add(view);
win.open();
2. Click on any of the view,(except the first view in the top most row).
Expected result:
2. The touched view should be removed.The rest of the views should not be affected.
Actual result:
2. The touched view gets removed.It leaves a black view in the top row at the left corner, which is not a part of the scrollview.It should not be there.You can see it by scrolling the scrollview up and down.
Bad code remove win.add(view); and all things are ok
Closing ticket as invalid.