如何使按钮透明的UITableViewCell的背景 [英] How to make background of UITableViewCell with buttons transparent

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

问题描述

在IB,在该文件的所有者是的UITableViewController的子类的.xib,一个单元的,我想从厦门国际银行加载结构是:

In IB, on the .xib where the file's owner is a subclass of UITableViewController, the structure of a cell that I wish to load from the xib is:

(UITableViewCell的)细胞 - >(的UIView)查看 - >(的UIButton)but1,but2,but3

(UITableViewCell)cell->(UIView)View->(UIButton)but1,but2,but3.

我想有按钮放在桌子上没有出现的单元格的帧/背景。

I am trying to have the buttons appear on the table without the frame/background of the cell.

我所做的单元格背景和视图的背景clearColor,但我现在得到的是对细胞黑色背景(带圆角),像这样:

I've made the cell's background and its View's background clearColor, but what I get now is a black background on the cell (with the rounded corners), like so:

由于所述的tableview背景的条纹的性质,如果我选择,对于细胞相同的背景,然后该条纹不会完全一致,因此是不能接受的。我需要的只是该死的细胞是半透明的,我不知道在哪里黑色的来源。

Because of the striped nature of the tableview's background, if I choose that same background for the cell then the stripes won't align perfectly, so it is not acceptable. I just need the damn cell to be translucent, I don't know where the black is coming from.

任何想法?

推荐答案

明白了。我以为我会发布它,如果任何人是在同一个困境:

Got it. Thought I'd post it if anybody else is in the same plight:

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

现在它看起来是这样的:

Now it looks like this:

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

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