UISheetPresentationController
4176 ワード
https://developer.apple.com/documentation/uikit/uisheetpresentationcontroller
図面の外観と動作を管理するためのプレゼンテーションコントロール.
Customize and Resize Sheets in UIKit
https://developer.apple.com/videos/play/wwdc2021/10063/
"A presentation controller that manages the appearance and behavior of a sheet."
図面の外観と動作を管理するためのプレゼンテーションコントロール.
Declaration
@MainActor class UISheetPresentationController : UIPresentationController
Overview
UISheetPresentationController
は、ビューコントローラを図面形式で表示することを可能にする.ビューコントローラを表示する前に、ページに必要な動作と外観があることを確認し、ビューコントローラのsheetPresentationController
プロパティにページプレゼンテーションコントローラを設定します.// In a subclass of UIViewController, customize and present the sheet.
func showMyViewControllerInACustomizedSheet() {
let viewControllerToPresent = MyViewController()
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)
}
「図面表示」コントローラは、図面の高さdetent
に基づいて図面寸法を最適化し、図面を自然に保つ.detent
では、ページに3つの異なる枠線を固定するときに、展開フレーム全体の枠線からサイズを変更できます.detent
は、図面使用をサポートするために具体化され、最近選択されたdetent
は、selectedDetentIdentifier
を使用して監視される.Related Sessions from WWDC21 Session 10063: Customize and Resize Sheets in UIKit
Customize and Resize Sheets in UIKit
https://developer.apple.com/videos/play/wwdc2021/10063/
See Also
Presentation Management
UIPresentationController
Reference
この問題について(UISheetPresentationController), 我々は、より多くの情報をここで見つけました https://velog.io/@panther222128/UISheetPresentationControllerテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol