您的位置:首页 > 其它

侧滑菜单 residemenu第三方的使用

2016-08-10 16:24 127 查看
residemenu 是一个类似QQ和网易新闻的侧滑菜单的第三方框架,使用很简单,但是自己都没有找到一些全面的注释和介绍,所以自己测试了一些属性,记录下。

github上的地址https://github.com/romaonthego/RESideMenu

这个第三方的使用很简单,

RESideMenu *sideMenuViewController = [[RESideMenualloc]
initWithContentViewController:tabbar leftMenuViewController:leftMenuViewController

                                                              
rightMenuViewController:rightMenuViewController];

    

    [self.windowmakeKeyAndVisible];

    self.window.rootViewController = sideMenuViewController;
调用这个方法,就能实现了左右划菜单的功能,tabbar,leftMenuViewController,rightMenuViewController替换自己的视图页面。
通过下面的方法切换页面

[self.sideMenuViewControllerpresentLeftMenuViewController];//切换到左视图

[self.sideMenuViewControllerpresentRightMenuViewController];//切换到右视图

[self.sideMenuViewControllerhideMenuViewController];
 //切换到主视图

下面是自己测试的一些属性

@property (assign,readwrite,
nonatomic)NSTimeInterval animationDuration;             //动画时间,默认0.35s

@property (strong,readwrite,
nonatomic)UIImage *backgroundImage;                     //背景图片

@property (assign,readwrite,
nonatomic)BOOL panGestureEnabled;                       //侧滑手势是否开启

@property (assign,readwrite,
nonatomic)NSUInteger panMinimumOpenThreshold;           //侧滑有效的滑动长度,默认60

@property (assign,readwrite,
nonatomic)IBInspectable
BOOL contentViewShadowEnabled;              //是否有阴影,默认no

@property (strong,readwrite,
nonatomic)IBInspectable
UIColor *contentViewShadowColor;            //阴影颜色,默认是黑色

@property (assign,readwrite,
nonatomic)IBInspectable
CGSize contentViewShadowOffset;             //阴影的偏移量

@property (assign,readwrite,
nonatomic)IBInspectable
CGFloat contentViewShadowOpacity;           //阴影透明度

@property (assign,readwrite,
nonatomic)IBInspectable
CGFloat contentViewShadowRadius;            //阴影图像的角度,默认是8.0f

@property (assign,readwrite,
nonatomic)IBInspectable
CGFloat contentViewScaleValue;              //高度比列,默认值为0.7,为1时高度不变

@property (assign,readwrite,
nonatomic)IBInspectable
CGFloat contentViewInLandscapeOffsetCenterX;    //不知道

@property (assign,readwrite,
nonatomic)IBInspectable
CGFloat contentViewInPortraitOffsetCenterX;     //主视图所剩余的宽度大小,默认是30,越小剩余越多

@property (assign,readwrite,
nonatomic)IBInspectable
BOOL parallaxEnabled;                       //视差,不太明白什么意思
属性就测试了这么多,还有一些属性看不懂,不过这些属性基本根据自己的需要进行一些调节了,希望有知道的朋友能够补充
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: