Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

TouchEnabled:false still passes click through...

I've got a "loading data" window that I show..

var messageWin = Titanium.UI.createWindow({
    height:'80%',
    width:'80%',
    borderRadius:30,
    touchEnabled:false,

    orientationModes : [
    Titanium.UI.PORTRAIT,
    Titanium.UI.UPSIDE_PORTRAIT,
    Titanium.UI.LANDSCAPE_LEFT,
    Titanium.UI.LANDSCAPE_RIGHT,
    ]
});
var messageView = Titanium.UI.createView({
    height:'80%',
    width:'80%',
    borderRadius:30,
    backgroundColor:'#000',
    opacity:0.7,
    touchEnabled:false
});

var messageLabel = Titanium.UI.createLabel({
    text:'',
    color:'#fff',
    width:'100%',
    height:'auto',
    font:{
        fontFamily:'Helvetica Neue',
        fontSize:60
    },
    textAlign:'center'
});

but even with TouchEnabled:false on both the window and the view.. I can still click on elements underneath the window..

any idea how to stop this?

— asked November 30th 2010 by Critter
  • touchenabled
0 Comments

4 Answers

  • touchEnabled: false will still pass clicks to parent views, it just won't register the event on the view that has the property.

    What I think you need is bubbleParent: false, which will stop the click event from propagating.

    Perhaps you will also need to set touchEnabled to true for it to work.

    — answered October 25th 2013 by Erik Håkansson
    permalink
    0 Comments
  • Critter

    You probably need to make messageWin a heavyweight window by setting a property like navBarHidden:false.

    Hope this works! :) If not, post again.

    — answered November 30th 2010 by Paul Dowsett
    permalink
    0 Comments
  • Oi mate..

    yeah.. just tried that.. I'm still able to click through the messageWin.

    — answered November 30th 2010 by Critter
    permalink
    0 Comments
  • well for now… I just enabled touch on both the view and the window.. added an eventListener to the window for click… and did nothing…

    that seems to be a decent hack..

    — answered November 30th 2010 by Critter
    permalink
    1 Comment
    • this trick had also worked for me…

      — commented August 2nd 2013 by Rakesh Rai
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.