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

EventListener issues in ScrollableView for IOS.

    Details

    • Story Points:
      5
    • Sprint:
      2016 Sprint 08 SDK

      Description

      Hello,

      Inside ScrollableView, i have added two views including some views & images. Their is a TableView & its rows in which scrollview is added.

      Also i have added some EventListener's on images which are not executed in case of IOS. It's working perfectly on Android.

      var args = $.args;
       
      var table = Ti.UI.createTableView({
      	editable : 'true',
      	// editing : 'true',
      	//id : 'table',
      	layout : "vertical",
      	separatorColor : "#1268b3"
      });
       
      var tableData = [];
      var i, row, header;
       
      for ( i = 0; i < 10; i++) {
       
      	row = Ti.UI.createTableViewRow({
      		id : i,
      		layout : 'horizontal',
      		color : '#0066cc',
      		height : '55'
      	});
       
      	var dataView = Ti.UI.createView({
      		layout : 'horizontal',
      		top : '0'
      	});
       
      	var textHolderView = Ti.UI.createView({
      		layout : 'vertical',
      		width : '50%'
      	});
       
      	var iconView = Ti.UI.createView({
      		layout : 'horizontal',
      		width : '24.5%'	//35dp
      	});
       
      	header = Ti.UI.createLabel({
      					text : "Some Text"+i,
      					font : {
      						fontSize : '12dp',
      						fontFamily : 'OpenSans-Semibold',
      						fontWeight : 'normal'
      					},
      					height : '38dp',
      					left : '15%',					
      					color : '#000',
      					width : '85%',
      					touchEnabled : false,
      					//borderColor:"black"
      				});
      				
      	var image1 = Ti.UI.createImageView({
      		image : "/images/individual.png",
      		height : '18dp',
      		left : '5dp',
      		width : '13%',
      		top : '25%'	
      	});
       
      	var slideOptionsView = Ti.UI.createView({
      		backgroundColor : "#1268b3",
      		layout : "horizontal"
      	});
       
      	var img_activity = Ti.UI.createImageView({
      		image : "/images/activity_temp.png",
      		height : "30dp",
      		width : "70dp",
      		left : "10%",
      		top : "15dp",
      		touchEnabled:true
      	});
      	
      	textHolderView.add(header);
      	iconView.add(image1);
      	dataView.add(textHolderView);
      	dataView.add(iconView);
      	
      	slideOptionsView.add(img_activity);
      	
      	var scroll = Ti.UI.createScrollableView({
      					views : [dataView, slideOptionsView],
      					showPagingControl : false,					
      				});	
      	
      	row.add(scroll);
      	tableData.push(row);
      	table.setData(tableData);
      		
      	// Event Listeners on click event for above images
      	img_activity.addEventListener('click', function(e) {
      		alert("img_activity");
      	});	
      	
      	image1.addEventListener('click', function(e) {
      		alert("image1");
      	});	
      }
       
      $.visitView.add(table);
      $.index.open();
      

      Attached some screenshots & files below.

      Versions Used:
      SDK 5.2.1.GA
      CLI 5.2.1

      Thanks.

      Note:
      I gave a try by removing TableView & row from above code.
      Problem lies with ScrollableView where Listeners are not getting called on click of any image. Scroll & other Listener events are working fine.

      // var table = Ti.UI.createTableView({
      	// id : 'table',
      	// layout : "vertical",
      	// separatorColor : "#1268b3"
      // });
       
      var tableData = [];
      var i,  header;
       
       
      // var row = Ti.UI.createTableViewRow({
      	// id : i,
      	// layout : 'horizontal',
      	// color : '#0066cc',
      	// height : '55'
      // });
       
      var dataView = Ti.UI.createView({
      	layout : 'horizontal',
      	top : '0'
      });
       
      var textHolderView = Ti.UI.createView({
      	layout : 'vertical',
      	width : '50%'
      });
       
      var iconView = Ti.UI.createView({
      	layout : 'horizontal',
      	width : '24.5%'	//35dp
      });
       
      header = Ti.UI.createLabel({
      	text : "Some Text",
      	font : {
      		fontSize : '12dp',
      		fontFamily : 'OpenSans-Semibold',
      		fontWeight : 'normal'
      	},
      	height : '38dp',
      	left : '15%',
      	color : '#000',
      	width : '85%',
      	touchEnabled : false,
      	//borderColor:"black"
      });
       
      var image1 = Ti.UI.createImageView({
      	image : "/images/individual.png",
      	height : '18dp',
      	left : '5dp',
      	width : '13%',
      	top : '25%'
      });
       
      var slideOptionsView = Ti.UI.createView({
      	backgroundColor : "#1268b3",
      	layout : "horizontal"
      });
       
      var img_activity = Ti.UI.createImageView({
      	image : "/images/activity_temp.png",
      	height : "30dp",
      	width : "70dp",
      	left : "10%",
      	top : "15dp",
      	touchEnabled : true
      });
       
      textHolderView.add(header);
      iconView.add(image1);
      dataView.add(textHolderView);
      dataView.add(iconView);
       
      slideOptionsView.add(img_activity);
       
      var scroll = Ti.UI.createScrollableView({
      	views : [dataView, slideOptionsView],
      	showPagingControl : false,
      });
       
      // row.add(scroll);
      // tableData.push(row);
      // table.setData(tableData);
       
      // Event Listeners on click for above images
      // img_activity.addEventListener('click', function(e) {
      	// alert("img_activity");
      // });
       
      Ti.API.info(i);
       
      	// scroll.addEventListener('click', function(e){
      		// alert(JSON.stringify(e.source));
      	// });
       
      image1.addEventListener('click', function(e) {
      	alert("image1");
      });
      //table
      $.someView.add(scroll); 
       
      $.index.open();
      

        Attachments

          Activity

            People

            • Assignee:
              apetkov Angel Petkov
              Reporter:
              Suraj Datta Suraj Datta
              Reviewer:
              Pedro Enrique (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code