我的问题仅出现在 iPad 上。默认情况下,我的容器 View 是清晰/透明的。它在 iPhone 上运行良好且显示良好,但在 iPad 上显示时它默认为白色背景。大多数自定义 uitableview 上也存在同样的问题。
我附上了下面问题的图片:
最佳答案
这基本上是我的问题的解决方案,我唯一需要添加并且我将附加快速代码的是使用 tableViewDelegate 的“willDisplayCell”方法。
覆盖 func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
var backgroundView : UIView = UIView(frame: CGRect.zeroRect)
backgroundView.backgroundColor = UIColor.clearColor()
cell.backgroundView = 背景View
cell.backgroundColor = UIColor.clearColor()
}
关于ios - 容器 View 白色背景,iPad Swift 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28688474/