在 UISheetPresentationController 中自定义较小的制动器? [英] Custom smaller Detents in UISheetPresentationController?
问题描述
Apple 终于发布了
使用UISheetPresentationController
,不是任何3rd方重新实现的底页,如何在底页上呈现Apple Maps风格的折叠小棘爪屏幕?
我提交了一份雷达请求支持.我建议其他任何想看到这一点的人也这样做.实际上,中型和大型不会削减它,如果在 iOS 15 发布之前没有添加第三方库,我们仍将依赖第三方库.
Apple has finally released an Apple Maps-style "bottom sheet" control in iOS 15 in 2021: UISheetPresentationController.
This type of sheet natively supports "detents", the heights at which a sheet naturally rests. The default large()
detent represents a full-screen sheet presentation, whereas the medium()
detent covers approximately half the screen.
However, there is no small()
detent in the API.
Apple Maps and similar apps typically show a small fully-collapsed sheet at the bottom of the screen, which can be dragged to half-height, which can be dragged to full-screen. Apple Maps actually shows a 1/3rd height screen, which appears to be different than the medium()
detent.
Using UISheetPresentationController
, not any 3rd-party reimplementation of bottom sheets, how can a sheet be presented with an Apple Maps-style collapsed small detent at the bottom of the screen?
I filed a radar to ask for support. I suggest anyone else who wants to see this does the same. Realistically medium and large won't cut it and we'll be relying on third party libs still if this doesn't get added before iOS 15 is released.
这篇关于在 UISheetPresentationController 中自定义较小的制动器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!