【问题标题】:How to increase SWRevealViewController sidebar Width?如何增加 SWRevealViewController 侧边栏宽度?
【发布时间】:2017-01-06 07:00:00
【问题描述】:

我使用了我的项目第三方应用程序SWReavelViewController。但我可以调整我的侧栏宽度。这是否可以调整宽度。

【问题讨论】:

  • 看我的回答,您可以根据您的要求使用我们的代码自定义它

标签: objective-c swrevealviewcontroller


【解决方案1】:

最好的方法是:

1. 打开SWRevealViewController.m 文件,然后得到_initDefaultProperties 方法。

2. 在这个_initDefaultProperties 方法中如下所示:

- (void)_initDefaultProperties
{
    _frontViewPosition = FrontViewPositionLeft;
    _rearViewPosition = FrontViewPositionLeft;
    _rightViewPosition = FrontViewPositionLeft;
    _rearViewRevealWidth = 260.0f; //  In this method you can 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.3;
    _toggleAnimationType = SWRevealToggleAnimationTypeSpring;
    _springDampingRatio = 1;
    _replaceViewAnimationDuration = 0.25;
    _frontViewShadowRadius = 2.5f;
    _frontViewShadowOffset = CGSizeMake(0.0f, 2.5f);
    _frontViewShadowOpacity = 1.0f;
    _frontViewShadowColor = [UIColor blackColor];
    _userInteractionStore = YES;
    _animationQueue = [NSMutableArray array];
    _draggableBorderWidth = 0.0f;
    _clipsViewsToBounds = NO;
    _extendsPointInsideHit = NO;
}

你必须做什么-而不是_rearViewRevealWidth = 260.0f;这一行_rearViewRevealWidth = Your_value.0f,根据你的要求改变值。

您可以根据自己的需要进行自定义。

谢谢你:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2013-10-16
    • 2018-10-26
    • 1970-01-01
    • 2016-12-23
    • 2017-04-08
    • 2017-12-06
    相关资源
    最近更新 更多