gpt4 book ai didi

objective-c - UIColor 颜色WithPatternImage : transparency issues in UITableView's separatorColor

转载 作者:技术小花猫 更新时间:2023-10-29 10:46:26 25 4
gpt4 key购买 nike

我在设置我的图案化 UIColor 时遇到了麻烦。在 iOS 5 中一切都很好,但在 iOS 4.3 中我遇到了问题。我添加了一张图片以便更好地理解。我已经用 Google 搜索了一下,发现答案可能是将 opaque 属性设置为 NO。但是我已经设置了每个 view, contentView, backgroundView, tableViewCell 它是 opaque 值为 NO

You can see that the separator color is black, where the image has of the pattern has transparency

可以看到分隔符颜色为黑色,其中图案的图像具有透明度

最佳答案

这似乎是 iOS 4.3 中的错误,他们已在 5.0 中修复。

要让它在 4.3 上运行,在将 View 的背景颜色设置为图案图像后,您需要将 View 和图层设置为不透明,如下所示:

UIImage* pattern = [UIImage imageNamed:@"translucentPatternImage.png"];
view.backgroundColor = [UIColor colorWithPatternImage:pattern];
[view.layer setOpaque:NO];
view.opaque = NO;

关于objective-c - UIColor 颜色WithPatternImage : transparency issues in UITableView's separatorColor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8325173/

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