如何使用SWRevealViewController显示调整大小的侧边栏?

Pre*_*ani 6 iphone objective-c ios swrevealviewcontroller swift

我在IOS应用程序(通用)中使用SWRevealViewController.我在iPhone和iPad上都有侧边栏,但我想显示侧边栏,它覆盖了90%的屏幕 - 我怎么能这样做?

Anb*_*hik 13

打开SWRevealViewController.m文件,然后你得到_initDefaultProperties方法.在这种方法中,您可以获得侧屏尺寸和位置

- (void)_initDefaultProperties
{
_frontViewPosition = FrontViewPositionLeft;
_rearViewPosition = FrontViewPositionLeft;
_rightViewPosition = FrontViewPositionLeft;
_rearViewRevealWidth = 260.0f;      /// this is the method u change the side bar width
_rearViewRevealOverdraw = 60.0f;
_rearViewRevealDisplacement = 40.0f;
_rightViewRevealWidth = 260.0f;
_rightViewRevealOverdraw = 60.0f;
_rightViewRevealDisplacement = 40.0f;
_bounceBackOnOverdraw = YES;
_bounceBackOnLeftOverdraw = YES;
_stableDragOnOverdraw = NO;
_stableDragOnLeftOverdraw = NO;
_presentFrontViewHierarchically = NO;
_quickFlickVelocity = 250.0f;
_toggleAnimationDuration = 0.25;
_frontViewShadowRadius = 2.5f;
_frontViewShadowOffset = CGSizeMake(0.0f, 2.5f);
_frontViewShadowOpacity = 1.0f;
_userInteractionStore = YES;
_animationQueue = [NSMutableArray array];
_draggableBorderWidth = 0.0f;
}
Run Code Online (Sandbox Code Playgroud)

  • 对于iPad,有UISplitViewController,所以你不需要一个SWRevealViewController.搜索谷歌的UISplitView. (4认同)