测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
释放最后发布 | 2015年1月 |
由Kien NGUYEN维护。
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
TaskDetailViewController *detailViewController = segue.destinationViewController;
detailViewController.task = sender;
// create animator object with instance of modal view controller
// we need to keep it in property with strong reference so it will not get release
self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
self.animator.dragable = YES;
self.animator.direction = ZFModalTransitonDirectionBottom;
[self.animator setContentScrollView:detailViewController.scrollview];
// set transition delegate of modal view controller to our object
detailViewController.transitioningDelegate = self.animator;
detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}
如果您的模态视图中包含可滚动的视图,并且您想通过拖拽来关闭模态视图,则需要将可滚动的视图设置到 ZFModalTransitionAnimator 实例中。
[self.animator setContentScrollView:detailViewController.scrollview];
您可以设置模态视图以何种方向出现。(默认为 ZFModalTransitonDirectionBottom)
self.animator.direction = ZFModalTransitonDirectionBottom;
备注:现在您只能使用 ZFModalTransitonDirectionBottom 来设置内容滚动视图。
Amornchai Kanokpullwad,[email protected]
ZFDragableModalTransition 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。