gpt4 book ai didi

ios - 组表单元格的透明背景

转载 作者:行者123 更新时间:2023-12-01 19:29:08 29 4
gpt4 key购买 nike

对于组表单元格,我陷入了这个问题。

cell.backgroundColor=[UIColor clearColor]

使单元格 bg 黑色。它适用于普通单元格,不适用于组表单元格。
我想添加一些按钮,例如喜欢透明背景的 iPhone 联系人的详细 View 。

最佳答案

如果有人遇到问题,我有一个解决方案,将透明 View 设置为单元格的背景 View 。然后它变得完全透明。然后您可以添加更多 View 或自定义单元格。

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

messageCell.contentView.layer.cornerRadius = 10.0;
messageCell.contentView.layer.borderWidth = 1.0f;
messageCell.contentView.layer.borderColor = [[Settings getInstance] colorFrameBorder].CGColor;
messageCell.selectionStyle = UITableViewCellSelectionStyleNone;
return messageCell;

该解决方案在我不记得的 StackOverflow 问题之一中被引用。
我还发现,在表格页眉或页脚中添加透明 View 很容易。联系详细信息下方的按钮可能已添加到页脚 View 中。

关于ios - 组表单元格的透明背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3839645/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com