如何为初学者逐步在 iOS 中创建滑出式菜单

how to create slide out menu in iOS step by step for beginner

我正在尝试在 iOS 中创建滑出菜单,但没有任何文章找到我逐步滑出演示。请指导我逐步创建滑出式菜单。

提前致谢。

在您的应用程序中添加滑出式侧边栏菜单 http://www.appcoda.com/ios-programming-sidebar-navigation-menu/

您可以使用以下代码显示带动画的幻灯片 in/out 视图。

-(void)showSlideInView
{

[UIView animateWithDuration:0.35
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseOut
                 animations:^{
                     self.slideInView.frame = CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height);

                 }
                 completion:^(BOOL completed){

                 }];
}


- (IBAction)hideSlideInView:(UIButton *)sender
{

[UIView animateWithDuration:0.25
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseIn
                 animations:^{
                     self.slideInView.frame = CGRectMake(-self.view.frame.size.width, 20, self.view.frame.size.width, self.view.frame.size.height);

                 }
                 completion:^(BOOL completed){
                 }];
}