![](/img/trans.png)
[英]Implement peek and pop to multiple UITableView in one UIViewController
[英]How to implement Peek and Pop in SwiftUI?
現在許多 iOS 應用程序使用Peek and Pop
快速呈現DetailView
的預覽。 但是,我在互聯網上找到的只是有關如何使用UIKIT
實現此功能的教程。
問題:如何使用SwiftUI 2.0
實現iOS Peek & Pop Functionality
以預覽DetailViews
?
SwiftUI 中沒有Peek and Pop
功能或 API。 它在 iOS 13 中已棄用。
相反,您可以使用可以添加到任何 SwiftUI 視圖的contextMenu
。
下面是 SwiftUI 中的示例:
HStack {
Text("Show Context Menu")
Spacer()
Text("Press & hold")
}
.contextMenu {
Button("Button 1 ") {}
Divider()
Button("Button 2") {}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.