Titanium Community Questions & Answer Archive

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

View width to take 100% of the layout

Hi,

Just a simple question, is there a way to set a view such as textField width so that it takes 100% of the layout?

Thanks,

— asked May 15th 2010 by Anh Tuan Kieu
  • view
0 Comments

2 Answers

  • Well,

    I found the solution, but I don't know if it is the clean way to do that. Just set the left and right property of your view so that the view is automatically fill the layout.

    var win = Titanium.UI.currentWindow;
    
    var query = Titanium.UI.createTextField({
            height:48,
        top: 10,
        left: 10,
        right: 10,
        value:'text',
        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
    });
    win.add(query);
    
    — answered May 15th 2010 by Anh Tuan Kieu
    permalink
    0 Comments
  • width:'100%'
    

    does not work?

    — answered May 15th 2010 by Dan Tamas
    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.