SWRevealViewController 隐藏后视控制器

SWRevealViewController hiding rear view controller

我正在使用 SWRevealViewController 设计滑出式菜单。我有一个带有静态单元格的 TableViewController 作为我的后视控制器。 table 视图是这样的 -

我只希望我的滑出式菜单是这样的,但我得到的是这样的东西,因为 SWRevealViewController 切断了我的后视控制器的某些部分 -

我希望我的幻灯片菜单必须完整显示我的 rearViewController 仍然显示打开按钮。如果可能,请提供建议或代码。提前致谢。

这就是为什么,因为它有 260 作为宽度静态值,要更改您需要打开 SWrevealviewcontroller.m 文件,滚动到第 647 行并将 _rearViewControllerWidth 的宽度从 260 更改为 360例子 !

祝你好运!

如果你想要一个全宽的 rearViewController,你可以这样做:

  1. Go to -(void)_initDefaultProperties in SWRevealViewController.m class.

  2. Change _rearViewRevealWidth = 260.0f; to _rearViewRevealWidth = [UIScreen mainScreen].bounds.size.width;

您也可以用同样的方法修改其他尺寸。

SWRevealViewController 中有一个属性 名为rightViewRevealWidth。您可以更改其值。

在您的第一个 viewController 中添加以下行 viewDidLoad()

self.revealViewController().rightViewRevealWidth = self.view.bounds.size.width - 80.0;