如何创建具有透明背景的 UITableViewCell [英] How to create a UITableViewCell with a transparent background

查看:37
本文介绍了如何创建具有透明背景的 UITableViewCell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 UITableViewCell 的背景颜色设置为透明.但似乎没有任何效果.我在 tableViewCell 中有一些图像/按钮,我想让白色的 grouptableview 背景消失以获得图像和按钮的浮动"效果(就好像它们不在 tableview 内).

I'm trying to set the background color of a UITableViewCell to transparent. But nothing seems to work. I have some images/buttons inside the tableViewCell and I would like to make the white grouptableview background disappear to get a 'floating' effect for the images and buttons (as if they were not inside the tableview).

知道如何做到这一点吗?

Any idea how this could be accomplished?

推荐答案

如果其他两个选项都不起作用,试试这个

If both the other options didn't work try this

UIView *backView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
backView.backgroundColor = [UIColor clearColor];
cell.backgroundView = backView;

这篇关于如何创建具有透明背景的 UITableViewCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆