0

In my iPhone application I have a view with table view on it. I need to set opacity for some cell of the table. I have tried:

UIView *backView = [[UIView alloc] initWithFrame:CGRectZero];
                backView.backgroundColor = [UIColor whiteColor];
                tableViewCell.backgroundView = backView;
                tableViewCell.backgroundView.alpha = 0.6f;

But I still not see the background of the view under table. How can I fix this?

4

3 回答 3

0

你在哪里设置了背景 alpha?您是否尝试在 tableView:willDisplayCell:forRowAtIndexPath:方法中设置它?

于 2013-08-15T14:33:26.310 回答
0

backView.layer.opacity = 0.6f

于 2013-08-15T09:25:14.470 回答
0

您还需要将表格视图的不透明度设置为0.6f

于 2013-08-15T10:21:14.693 回答