Search code examples
textbackgroundtitanium

Titanium Text in tableview row has background


I am making an app with a sliding menu on the left (see http://mobile.tutsplus.com/tutorials/appcelerator/titanium-mobile-create-a-sliding-menu-for-ios/). And I'm trying to add a background to the rows, but every time I try that and I start the simulator, the background can only be seen a little bit because there's a white background behind the title of the row for some reason. Here's the code:

    var menuTitles = [
       {title: 'Home', backgroundImage: "images/row_BG.png", id: 1},
       {title: 'Vestigingen', height: 30, font:{fontSize: 14, fontWeight: "bold", fontFamily: "Helvetica"}},
       {title: 'Han Fortmann', backgroundImage: "images/row_BG.png", leftImage: 'images/[email protected]', id: 2, font:{fontSize: 14, fontWeight: "normal", fontFamily: "Helvetica"}},
       {title: 'Johannes B.', leftImage: 'images/[email protected]', id: 3, font:{fontSize: 14, fontWeight: "normal", fontFamily: "Helvetica"}}
    ];

Solution

  • Maybe you should precise the Titanium version you're using to get more accurate answers.

    Nevertheless, I think the answer you're looking for is the backgroundColor: 'transparent' property. Try this, and it should work :

    {backgroundColor: 'transparent', title: 'Home', backgroundImage: "images/row_BG.png", id: 1}