ios - 容器 View 白色背景,iPad Swift 问题

标签 ios objective-c swift

我的问题仅出现在 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/

相关文章:

iphone - 音乐播放器只播放一首轨道

objective-c - XPC客户端等待服务加载

iphone - iOS 7 表格 View 无法自动调整内容插入

iphone - 通过 Iphone 发送短信,MFMessageComposeViewController

ios - 警告 : itunes store operation failed error (null)

swift - 使用 AVAudioEngine 的实时音频

swift - 检测任何 VC 中的用户不活动

ios - 自定义 Viewcontroller 转换未正确调整大小

ios - 我如何从嵌套的 NSMutableDictionary 中获取 numberOfRowsInSection?

ios - iOS 应用程序名称中的特殊字符或图像