如何设置 space of sw_rear 和 right Edge SWRevealViewController

How to set space of sw_rear and right Edge SWRevealViewController

点击查看图片MY sw_rear

当运行

点击查看图片Space is 1/3 of display

但我想设置 space 是显示的 5/6

宽度由 SWRevealViewController 上的 rearViewRevealWidth 控制。

例如:

revealViewController = SWRevealViewController(rearViewController: myRearViewController, 
                                              frontViewController: myFrontViewController)
revealViewController.rearViewRevealWidth = myWidth

其中宽度为 CGFloat

来自 rearViewRevealWidth 的文档属性:

Defines how much of the rear or right view is shown, default is 260. Negative values indicate that the reveal width should be computed by substracting the full front view width, so the revealed frontView width is kept constant when bounds change as opposed to the rear or right width.

您可以更改宽度,例如在 SWL

中使用 rearViewRevealWidth 的 属性

// so the revealed frontView width is kept constant when bounds change as opposed to the rear or right width.

@property (nonatomic) CGFloat rearViewRevealWidth;

Objective-C

revealViewController.rearViewRevealWidth=self.view.frame.size.width-100.0f; //customize the width/space

Swift

revealViewController!.rearViewRevealWidth=self.view.frame.size.width-100 //customize the width/space