如何在IOS7中使UITableView透明?

voi*_*ous 15 objective-c transparent uitableview ios

我在IOS7中尝试了很多次和UITableView透明的很多方法,但它仍然不起作用.我没有任何想法......

"[cell setBackgroundColor:[UIColor clearColor]];"


UIView* bgv = [[UIView alloc] init];
bgv.backgroundColor = [UIColor clearColor];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:bgv];

cell.backgroundColor = [UIColor colorWithRed:(247.0/255.0)
                                 green:(151.0/255.0)  blue:(121.0/255.0) alpha:.3];
Run Code Online (Sandbox Code Playgroud)

我试过这3种方法,但仍然无效.

有人可以提供一些关于这个问题的提示吗?

非常感谢〜

小智 17

用这个

cell.contentView.backgroundColor = [UIColor clearColor];
        cell.backgroundColor = [UIColor clearColor];
        tableView.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)


Car*_*loS 15

您需要将tableView的背景设置为清除颜色,您需要对表视图的引用.


小智 5

您只需要清除TableView单元格颜色即可。然后从属性列表中选择tableview背景色。或设置tblobj.backgroundcolor ...

cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)