Phi*_*ann 2 transparency objective-c ios aqgridview
我在定制AQGridViewCell时遇到问题.我想让整个单元格具有透明背景,但initWithFrame中的以下内容:reuseIdentifier不能完成这项工作:
self.backgroundView.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
self.backgroundColor = [UIColor clearColor];
self.backgroundView.opaque = NO;
self.contentView.opaque = NO;
self.opaque = NO;
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?
非常感谢您的回复!
编辑 我发现了这个,但这似乎也不起作用:https: //github.com/AlanQuatermain/AQGridView/pull/108#issuecomment-3610006
链接中的提示已经到了一半.以下为我做了诀窍:
self.contentView.backgroundColor = nil;
self.backgroundColor = nil;
Run Code Online (Sandbox Code Playgroud)
你需要把它放在你的自定义AQGridViewCell中initWithFrame:reuseIdentifier:.你必须设置两个属性但至少它有效,这有点令人费解.
另请注意,您还需要为clear您可能拥有的所有文本标签设置背景颜色,例如:
captionLabel.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)
将标签背景设置为nil无效 - 它显示为黑色.
| 归档时间: |
|
| 查看次数: |
646 次 |
| 最近记录: |