Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20301

Memory lack using scrollableview and many buttons. Buttons event don't works.

    Details

    • Story Points:
      1

      Description

      With sdk 5.1.2 I try the code in new project on iPad2 simulator without LiveView and it works fine but not in my real project. Now, in the new project, I have tried with 90 iterations and clicks works for first 18 buttons, in 5.1.1 works fine in all buttons.

              var win = Ti.UI.createWindow({backgroundColor: 'white'});
      	
      	var data = [];
      	var c =1;
      	
      	for(var i=1; i<=90; i++){
      		
      		if (c == 1) {
      			var page_view = Ti.UI.createView({
      				layout: 'horizontal'
      			});
      		}
      	
      		var view = Ti.UI.createView({
      			backgroundColor: 'green',
      			width : 250,
      			left: 5
      		});
      	
      	
      	
      		var button = Ti.UI.createButton({
      			bottom : 10,
      			left : 10,
      			right : 10,
      			height : 40,
      			color : '#fff',
      			backgroundColor : 'red',
      			title : "click",
                  ids: i
      		});
      	
      	
      		view.add(button);
      	
      	
      		button.addEventListener('click', function(e) {
      			Ti.API.info('button: ' + e.source.ids);
      		});
      		
      		page_view.add(view);
       
      		if (c % 3 == 0) {
      			data.push(page_view);
      			c = 1;
      		} else {
      			c++;
       
      			if (i == 90) {
      				data.push(page_view);
      			}
      		}
       
      	}
       
      	var scroll_view = Ti.UI.createScrollableView({
      		showPagingControl : true,
      		top : 130,
      		views: data,
      		layout: 'horizontal'
      	});
       
       
       
      	win.add(scroll_view);
      

      http://stackoverflow.com/questions/35103130/multiple-buttons-dont-fire-clicks-event-5-1-2-memory-lack/35103813#35103813

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              otto.pic Lorenzo Piccinini
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20908
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code