【问题标题】:Swift : Change Tableview Width to 1/2 its sizeSwift:将 Tableview 宽度更改为其大小的 1/2
【发布时间】:2015-12-09 20:59:25
【问题描述】:

我按照本教程没有成功,因为它在 Objective-C 中 :

http://code.tutsplus.com/tutorials/implementing-container-containment-sliding-menu-controller--mobile-14562

如何在 SWRevealViewController Rt. 中更改 tableview 的大小。菜单大小的 1/3 还是 1/2?

tableView.frame = CGRectMake(50, 210, self.view.frame.size.width/2, self.view.frame.size.height)

再试一次

tableView.frame = CGRectMake(tableView.frame.origin.x, tableView.frame.origin.y, self.view.frame.size.width/2, self.view.frame.size.height)

【问题讨论】:

    标签: ios swift uitableview swrevealviewcontroller


    【解决方案1】:

    自定义菜单

    SWRevealViewController 类提供了许多用于配置侧边栏菜单的选项。比如说,如果你想改变菜单的宽度,你可以更新 backViewRevealWidth 属性的值。尝试在NewsTableViewController的viewDidLoad方法中插入如下代码:

    self.revealViewController().rearViewRevealWidth = 62
    

    在此处关注详细信息http://www.appcoda.com/sidebar-menu-swift/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-09
      • 2015-12-14
      • 1970-01-01
      • 2021-02-25
      • 2011-12-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多