作者:枝玫焰 | 来源:互联网 | 2023-05-20 17:23
我的问题只发生在iPad上.默认情况下,我的容器视图是透明/透明的.它在iPhone上运行正常,但在iPad上显示时默认为白色背景.大多数自定义uitableviews的问题也是如此.
我附上了下面问题的图片:
![](https://img.php1.cn/3cd4a/1eebe/cd5/7cccb7e4b6cb5cb8.webp)
1> Austin Sweat..:
这基本上是我的问题的解决方案,只有我必须添加的东西,我将使用tableViewDelegate附加swift代码是"willDisplayCell"方法.
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
var backgroundView : UIView = UIView(frame: CGRect.zeroRect)
backgroundView.backgroundColor = UIColor.clearColor()
cell.backgroundView = backgroundView
cell.backgroundColor = UIColor.clearColor()
}