iOS 16扩展的UISheetPresentationController
API中是否有方法为显示的表单设置最小制动高度?(即,使其不会从屏幕上消失?)
演示代码示例:
let viewControllerToPresent = UIViewController()
if let sheet = viewControllerToPresent.sheetPresentationController {
sheet.detents = [.medium(), .large()]
sheet.largestUndimmedDetentIdentifier = .medium
sheet.prefersScrollingExpandsWhenScrolledToEdge = false
sheet.prefersEdgeAttachedInCompactHeight = true
sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true
}
present(viewControllerToPresent, animated: true, completion: nil)
1条答案
按热度按时间bq3bfh9z1#
添加
viewControllerToPresent.isModalInPresentation = true
作为属性可以实现这种体验。