Titanium Community Questions & Answer Archive

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

Tableview background image

Adding a background image to a tableview as below put the same small piece of the image in each cell.
I expected the complete image to be behind the whole table.

// create table view
var tableview = Titanium.UI.createTableView({
data:data,
opacity:'.4',
backgroundImage:'Default.png'
maxRowHeight:'20'
});

— asked March 18th 2010 by Eldon Benz
  • iphone
  • tableview
0 Comments

5 Answers

  • I'm having this same issue.

    I have a background image for my main UIView:

    Titanium.UI.setBackgroundImage('images/main_bg.jpg');

    Then, I have a table that uses the GROUP style. The default background for this is the light grey pinstripe one. I'd like to make that light grey go away entirely to reveal the main background underneath.

    UPDATE:

    I just discovered you can use this:

    backgroundColor:'transparent'

    Think that'll do the trick

    — answered April 1st 2010 by Marshall Jones
    permalink
    1 Comment
    • backgroundColor:'transparent' does do the trick!!

      — commented March 6th 2011 by Ted Haeger
  • Try this:

    //Set window background
    Ti.UI.setBackgroundImage('Default.png');
    
    //Create table view
    var tableview = Titanium.UI.createTableView({
        data:data,
        opacity:'.4',
        maxRowHeight:'20',
        //Set BG transparent
        backgroundColor:'transparent',
        //Set row color - white
        rowBackgroundColor:'white'
    });
    
    — answered April 24th 2010 by Nikko Paolo Palima
    permalink
    0 Comments
  • You're right. I don't know what it's supposed to do.

    [ Just also a note that the image in the row is repeated and is aligned to the bottom left of the image. ]

    — answered March 18th 2010 by Kosso
    permalink
    0 Comments
  • You can set the Background of the windows or view as your image and then set the tableview as transparent. Don't know if that helps.

    win = Ti.UI.CurrentWindow;
    win.backgroundImage = 'Default.png';
    
    // create table view 
    var tableview = Titanium.UI.createTableView({ data:data, opacity:'.4', maxRowHeight:'20' });
    
    — answered March 19th 2010 by Antonio Silveira
    permalink
    0 Comments
  • That just sets the transparency of hte table rows - is there a way to have the table rows be white at full opacity, and the background show underneath?

    — answered March 31st 2010 by Marshall Jones
    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.