自定义底部弹窗
效果图:
底部弹窗.gif
相关源码如下:
ContentView.swift
import SwiftUI
struct ContentView: View {
@State var isPresented = false
var body: some View {
VStack {
Text("点我")
.foregroundColor(Color.orange)
.onTapGesture {
isPresented.toggle()
}
}.frame(maxWidth: .infinity, maxHeight: .infinity)
.showCSBottomSheet(isPresented: $isPresented)
}
}
CSBottomSheet.swift
网友评论