UipresentationController多种尺寸或驱动器
我正在尝试实现一个基本上模仿UisheetPresentationController的行为的演示控制器。我之所以这样做是因为我想添加第三个刀具,也希望它适用于iOS 14,因此我无法使用现有的UisheetPresentationController。
我可以在其中呈现一个视图控制器的地方,它将停在一个位置(例如屏幕高度的50%)。然后,我有一个平底锅手势,当活动开始时,即将解雇视图控制器。如果在手势结束时将视图控制器拉下,则视图被驳回,否则取消了视图,并且视图返回到50%的高度。
这一切都很好。但是,如何添加多个停止或驱动器? PAN手势开始了交互式解雇,但解雇不支持视图控制器最终出现的多个不同的位置。
有人知道苹果如何在UisheetPresentationController中实现其“驱动器”?还是有人对如何实施有任何建议?
I am working on trying to implement a presentation controller that essentially mimics the behavior of the UISheetPresentationController. I am doing this because I want to add a third detent and also I want this to work for iOS 14, so I cannot use the existing UISheetPresentationController.
I have it where I can present a view controller and it will stop at one location (say 50% of the screen height). And then I have a pan gesture that, when active, starts the interactive dismissal of the view controller. If the view controller is pulled down so far when the gesture ends, the view is dismissed, otherwise the dismissal is cancelled and the view returns to the 50% height.
That is all working fine. But then how do I add multiple stops, or detents? The pan gesture starts an interactive dismissal, but that dismissal does not support multiple different places where the view controller could end up.
Does anyone know how Apple implements their "detents" in the UISheetPresentationController? Or does anyone have any suggestions on how this might be implemented?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也可以将其添加到您的
.sheet {}
或
You can also add this to your
.sheet{}
or