Titanium Community Questions & Answer Archive

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

Invisible Button Not Working

I am trying to make an invisible button. The problem I am having is when I make the button invisible, it is no longer clickable. I am using opacity:0.0 to make the button invisible. This does not work but setting the opacity to 0.1 or higher works. My code is below, I hope someone will be able to point me in the right direction.

var b1 = Titanium.UI.createButton({
    opacity:0.0,
    top:20,
    width:300,
    height:300
    });
— asked October 31st 2010 by David Dushok
  • button
  • invisible
  • mobile
0 Comments

2 Answers

  • Accepted Answer

    You don't have to use a button to get a click. You could do this

    var b1 = Titanium.UI.createView({
        top:20,
        width:300,
        height:300
        });
    

    This would essentially create an empty view that is transparent and can receive a click event.

    — answered October 31st 2010 by John McKnight
    permalink
    1 Comment
    • I am trying this very thing, and it is not working. No response to any clicks whatsoever. Is a special event handler needed or something?

      — commented June 17th 2011 by John Davis
  • Not sure why you'd need a clickable invisible button. But, try using a transparent png file. You can set a click event handler on the image.

    — answered October 31st 2010 by Tim Poulsen
    permalink
    0 Comments
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.