【问题标题】:SWRevealViewController not working on iPadSWRevealViewController 在 iPad 上不起作用
【发布时间】:2016-08-01 17:16:03
【问题描述】:

我在我的应用程序中使用 SWRevealViewController 作为菜单。从今天起,该应用程序仅适用于 iPhone。现在我想让它为 iPad 做好准备,但有一个问题(看图片。第一个在 iPhone 上显示应用程序(看起来很正常),第二个在 iPad 上显示(看起来完全不同))。

为什么 iPad 上是白色的?

感谢您的帮助!

【问题讨论】:

    标签: ios swift swrevealviewcontroller


    【解决方案1】:

    我自己解决了这个问题。

    对于菜单,您使用 tableView(Controller)。在tableView或tableViewController的类中需要添加如下函数:

    override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
        cell.backgroundColor = UIColor.clearColor()
    }
    
    • 使用 UITableViewController 时需要覆盖
    • 如果你在storyboard中使用一个静态的TableViewController作为menuTableViewController并且没有一个类,只需生成一个类并删除它的所有代码并从上面添加函数。然后将该类添加到情节提要中的 MenuTableViewController。

    【讨论】:

      猜你喜欢
      • 2014-01-07
      • 2016-04-19
      • 2016-04-23
      • 2015-11-06
      • 2011-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多