Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11527] iOS: View: Removing a view from ScrollView leaves a black view at first position

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2012-10-22T20:11:27.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-ios100112
ReporterShyam Bhadauria
AssigneeVishal Duggal
Created2012-10-18T10:08:17.000+0000
Updated2017-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.

Comments

  1. Vishal Duggal 2012-10-22

    Bad code remove win.add(view); and all things are ok
  2. Lee Morris 2017-03-17

    Closing ticket as invalid.

JSON Source