gpt4 book ai didi

iphone - UITableViewCell背景(图案)

转载 作者:行者123 更新时间:2023-12-03 21:22:39 26 4
gpt4 key购买 nike

我正在使用自定义的 uitableviewcell,并尝试重新创建一张活页纸作为背景。由于每个单元格都会根据文本量而增长,因此我需要为每个单元格的背景使用一个图案。但我对这些黑线有疑问,这让我发疯!

我已经确保表格 View 和单元格一样不透明。

如果我设置单元格backgroundView的backgroundColor = [UIColor redColor],它会显示红色背景,没有黑线。你知道这里会发生什么吗?

在我的 View Controller 中完成:

 cell.backgroundView = [[[UIView alloc] init] autorelease];

bgImage = [UIImage imageNamed:@"blogs-cell-middle.png"];

((UIView *)cell.backgroundView).backgroundColor = [UIColor colorWithPatternImage:bgImage];

http://www.freeimagehosting.net/uploads/91a1a9bfea.png

注意最左侧、右侧边缘附近的黑线,以及底部的双黑线。

最佳答案

好吧,我知道发生了什么了。由于某种原因,我必须设置

cell.backgroundView.opaque = NO

图案设置后。事先这样做是行不通的。

关于iphone - UITableViewCell背景(图案),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3327254/

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