Tableview row opacity ios doesn't work

You must Login before you can answer or comment on any questions.

Hi all, I have a label with a background image and over it a tableview with a list of rows. I need to give the tableview rows an opacity so the label will appear and the rows still shown. How can I give a tableview row an opacity on ios? On Android its working but on iPad not!

var row = Titanium.UI.createTableViewRow({
        id : rows.fieldByName('Id'),
        className:'simplerow', // Very important for rendering. Because the parser will consider all rows having the same className as a row having the same design,
                               // just the content will change. 
        height : '50px',
        backgroundColor : row_color,
       // backgroundSelectedColor : '#960000', // When you click on the row
        rowTitle: '', // This variable will handle the title of the row, so we can catch it later
        opacity: 0.4,
        left : '6%',
        rightImage : 'right_arrow-'+Titanium.Platform.osname+'.png'
 
    });
 
    // Title for the row
   var title = Titanium.UI.createLabel({
        className:'simplelabel', 
        //backgroundSelectedColor : '#960000',
        text    : " "+rows.fieldByName('F_Keyword'),
        font    : { fontSize: 20, fontWeight: 'bold' },
        height  : '100%',
        width   : '100%',
        color   : '#fff'
 
    });
 
 
 
   row.add(title);
   row.rowTitle = title;
   row.rowID = row.id;
 
 
   // This is an approach without using Table view rows and labels (FASTER THAN THE ABOVE ONE)
   dataArray.push(row);

— asked 11 months ago by Anthony Tannoury
2 Comments
  • Hi Anthony,

    Try to set opacity in label.

    — commented 11 months ago by Nitin Chavda

  • on the label its working, but its not a solution because if i put the opacity to the label, the text in the label will also have an opacity, which i don't want! What I need is to have a clear text 100% opacity and the color of the row with an opacity.

    — commented 11 months ago by Anthony Tannoury

1 Answer

Why you don't create a view into your row. You put everythings into your row and you write:

backgroundColor:'transparent'
So after the background of your row is ..... your view !

Your Answer

Think you can help? Login to answer this question!