Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set UITableView cell alpha?

I have to set the cells alpha to minimum. I try the following code in cell for row, it's not working. I've also set opaque but it's still not working. Anyone have an idea about this?

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) 
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.alpha =0.5;
like image 385
triveni Avatar asked Sep 29 '11 07:09

triveni


People also ask

How can we use a reusable cell in UITableView?

For performance reasons, a table view's data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView(_:cellForRowAt:) method. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse.

How do I populate UITableView?

There are two main base ways to populate a tableview. The more popular is through Interface Building, using a prototype cell UI object. The other is strictly through code when you don't need a prototype cell from Interface Builder.

How do you add a space between UITableView cells?

The way I achieve adding spacing between cells is to make numberOfSections = "Your array count" and make each section contains only one row. And then define headerView and its height. This works great.


1 Answers

try this..

cell.contentView.alpha = 0.5;
like image 155
Hadi Avatar answered Oct 20 '22 09:10

Hadi