27.转场效果MZFormSheetPresentationController

网址: (https://github.com/m1entus/MZFormSheetPresentationController)
场景应用:两个场景的转场,例如首页点击登录按钮,屏幕中间弹出登录的vc

 LoginViewController *loginVC = [LoginViewController create];
    MZFormSheetPresentationViewController *formSheetController = [[MZFormSheetPresentationViewController alloc] initWithContentViewController:loginVC];
    [formSheetController setContentViewControllerTransitionStyle:MZFormSheetPresentationTransitionStyleBounce];
    [MZFormSheetPresentationController appearance].shouldCenterHorizontally = YES;
    [MZFormSheetPresentationController appearance].shouldCenterVertically = YES;
    [MZFormSheetPresentationController appearance].movementActionWhenKeyboardAppears = MZFormSheetActionWhenKeyboardAppearsCenterVertically;
    formSheetController.interactivePanGestureDismissalDirection = MZFormSheetPanGestureDismissDirectionNone;
     [viewController presentViewController:formSheetController animated:YES completion:nil];

MZFormSheetPresentationController
provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup controller size
and feel form sheet.
它提供了一种接近原生iOS的模态窗口,添加了对iPhone的支持,另外可以设置大小以及触摸。

MZFormSheetPresentationController
also has a number of predefined transitions so you can customize whether the modal form slides in, fades in, bounces in or you can create your own custom transition.
它也有很多预定义的转场效果,你可以定制slides in,fades in, bounces in等效果或者你可以创建自己的自定义转场。

There are also a number of properties for customizing the exact look and position of the form.
对于定制准确的样子和窗口的位置,它也有很多属性。
It support also pan gesture dismissing.它也支持手势消失。
This project is continuation of MZFormSheetController
which allow you to make form sheet when deployment target is set to >iOS5 but use some tricky UIWindow hacks.
Here are a couple of images showing MZFormSheetPresentationController
in action:

There are two example projects, one is for Objective-C

UINavigationController *navigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"formSheetController"];
MZFormSheetPresentationViewController *formSheetController = [[MZFormSheetPresentationViewController alloc] initWithContentViewController:navigationController];
formSheetController.presentationController.contentViewSize = CGSizeMake(250, 250); // or pass in UILayoutFittingCompressedSize to size automatically with auto-layout

[self presentViewController:formSheetController animated:YES completion:nil];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容