我使用 SWRevealViewController 作为我的应用程序中的菜单。从今天起,该应用程序仅适用于 iPhone。现在我想让它为 iPad 做好准备,但有一个问题(看图片。第一个显示的是 iPhone 上的应用程序(看起来正常),第二个显示的是 iPad 上的应用程序(看起来完全不同))。
为什么 iPad 上是白色的?
感谢您的帮助!
最佳答案
我自己解决了这个问题。
对于菜单,您使用 tableView( Controller )。在tableView或tableViewController的类中,您需要添加以下函数:
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.backgroundColor = UIColor.clearColor()
}
- 使用 UITableViewController 时需要覆盖
- 如果你在storyboard中使用静态TableViewController作为menuTableViewController并且没有它的类,只需生成一个类并删除它的所有代码并添加上面的函数即可。然后将该类添加到 Storyboard 中的 MenuTableViewController 中。
关于ios - SWRevealViewController 无法在 iPad 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38704547/