Titanium Community Questions & Answer Archive

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

switch not clickable inside view

If i put a switch inside one of my views the switch is not clickable. If i put that same switch in say the titlebar, rightnavbar, or the actual window the switch works like it should.

Is this just a function of the switch? It needs to be placed directly in a window and can't be placed in a view?

Code:


    var viewHave = Ti.UI.createView({
        width:320,
        height:'auto',
        top:50,
        visible:'true'
    });    

var swtchHave = Ti.UI.createSwitch({
        value:true,
        top:240

    });


    //add elements to 'Have'
    viewHave.add(swtchHave);
      curWin.add(viewHave);
— asked July 16th 2010 by John Scanlon
  • iphone
0 Comments

1 Answer

  • It should work out of the box with your code.

    Try to remove the 'visible' property and use show()/hide(), as far as I know 'visible' is only a getter, so something maybe breaks when you set this.

    — answered July 16th 2010 by Dan Tamas
    permalink
    1 Comment
    • Tried that, still no go.

      — commented July 16th 2010 by John Scanlon
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.