Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10361] TiAPI: TouchPassThrough for views

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsAndroid, iOS
Labelsapi, touch, transparent, view
ReporterMartin Guillon
AssigneePedro Enrique
Created2012-08-08T10:19:13.000+0000
Updated2015-04-13T20:09:45.000+0000

Description

It would be nice to be able to set touchPassThrough for a view: When clicking on a transparent part of the view, the touch is sent to the parent.

Comments

  1. Martin Guillon 2012-08-08

    pull request: https://github.com/appcelerator/titanium_mobile/pull/2696
  2. Martin Guillon 2012-08-08

    test case
       var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});
         
       var button = Titanium.UI.createButton({
           title:'you can touch me!',
           width:200,
           height:40,
           top:20
       });
         
       button.addEventListener('click', function()
       {
           alert("you clicked me when i am actually under another view!");
       });
       
       var button2 = Titanium.UI.createButton({
           title:'you cant touch me!',
           width:200,
           height:40,
           bottom:20
       });
         
       button2.addEventListener('click', function()
       {
           alert("that shouldn t happen!");
       });
       
       
       win.add(button);
       win.add(button2);
       
       var view = Ti.UI.createView({
           top:0,
           touchPassThrough:true,
           height:'50%'   
       });
       
       var view2 = Ti.UI.createView({
           bottom:0,
           height:'50%'   
       });
       
       win.add(view);
       win.add(view2);
       
       win.open();
       
       
  3. Martin Guillon 2012-08-14

    It s now also working on android. See the pull request https://github.com/appcelerator/titanium_mobile/pull/2696
  4. Dawson Toth 2012-08-14

    I can vouch for the validity of these use cases, and others. I've encountered these in apps I've built for Appcelerator, and having this property would greatly reduce the complexity of my code in some cases and make other cases, formerly impossible, possible.

JSON Source