TWTSideMenuViewController向右打开而不是左边

时间:2014-09-26 07:12:40

标签: ios objective-c

我将在我的应用程序中使用TWTSideMenuViewController,但我的应用程序将有一个正确的菜单而不是左侧菜单。所以,我想知道如何编辑TWTSideMenuViewController https://github.com/twotoasters/TWTSideMenuViewController向右打开而不是向左打。

感谢

1 个答案:

答案 0 :(得分:0)

没问题!修改closeTransformForMenuViewopenTransformForMenuView方法,如下所示:

- (CGAffineTransform)closeTransformForMenuView
{
    CGFloat transformSize = 1.0f / self.zoomScale;
    CGAffineTransform transform = CGAffineTransformScale(self.menuViewController.view.transform, transformSize, transformSize);
    return CGAffineTransformTranslate(transform,
                                      -(-(CGRectGetMidX(self.view.bounds)) - self.edgeOffset.horizontal),
                                      -self.edgeOffset.vertical);
}

- (CGAffineTransform)openTransformForView:(UIView *)view
{
    CGFloat transformSize = self.zoomScale;
    CGAffineTransform newTransform = CGAffineTransformTranslate(view.transform, -(CGRectGetMidX(view.bounds) + self.edgeOffset.horizontal), self.edgeOffset.vertical);
    return CGAffineTransformScale(newTransform, transformSize, transformSize);
}