我将在我的应用程序中使用TWTSideMenuViewController,但我的应用程序将有一个正确的菜单而不是左侧菜单。所以,我想知道如何编辑TWTSideMenuViewController https://github.com/twotoasters/TWTSideMenuViewController向右打开而不是向左打。
感谢
答案 0 :(得分:0)
没问题!修改closeTransformForMenuView
和openTransformForMenuView
方法,如下所示:
- (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);
}