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

iOS & Android: Adding view to Table View Row object does not provide proper x, y co-ordinates in window touchstart event.

    Details

      Description

      Adding a view object to tableViewRow object, does not provide proper touch co-ordinates in window touchstart event.

      *Another way to say the same is:*
      Adding a view object to tableViewRow object, does not allow to get absolute co-ordinates over window to find where touch happened.

      var win = Ti.UI.createWindow({
      	backgroundColor : 'gray'
      });
       
      var data = [];
       
      var tbView = Ti.UI.createTableView({
      bubbleParent:true
      });
       
      var view1 = Ti.UI.createView({
      height:"100dp",
      width:"100dp",
      backgroundColor:"blue",
      zIndex:10,
      visible:false
      });
       
      for (var i = 0; i < 4; i++) {
       
      	var rowview1 = Ti.UI.createView({
      		height : "30dp",
      		width : "320dp",
      		backgroundColor : "yellow",
      	});
      	
      	var rowview1lable = Ti.UI.createLabel({
      		text:"row : " + i,
      		backgroundColor : "yellow",
      	});
      	
      	rowview1.add(rowview1lable);
      	
      	var row = Ti.UI.createTableViewRow({
      		height:"60dp",
      		width:"320dp",
      		title : "row : "+i,
      		bubbleParent : true
      	});
       
      	row.add(rowview1); // commenting this will work the way it should, window touch start will get correct x, y co-ordinates.
      	
      	data.push(row);
      }
       
      tbView.data = data;
       
      win.add(tbView);
       
      win.addEventListener("touchstart", function(e) {
      	view1.top = e.y;
      	view1.left = e.x;
       
      	view1.visible = true;
      	win.add(view1);
      	setTimeout(function() {
      		view1.visible = false;
      		win.remove(view1);
       
      	}, 2000);
      });
       
      win.open(); 
      

        Attachments

          Activity

            People

            • Assignee:
              ingo Ingo Muschenetz
              Reporter:
              anigam Ashish Nigam
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code