https://zenn.dev/oka_yuuji/articles/6b5d8ca2917707
@State var show = false
@State var showFull = false
@State var position = CGSize.zero
@State var viewSize = UIScreen.main.bounds
@State var higthRate = 0.35
ZStack {
Rectangle()
.foregroundColor(.yellow)
VStack {
RoundedRectangle(cornerRadius: 10)
.frame(width: 60, height: 5)
.padding(.top)
Spacer()
}
}
.cornerRadius(20)
.offset(y:show ? viewSize.height * 0.4 : viewSize.height)
.offset(y: position.height)
.animation(.timingCurve(0.2, 0.8, 0.2, 1, duration: 0.9), value: show)
+背景
if (showModal) {
Button {
showModal = false
//focusTextField = false
} label: {
Color.black.opacity(0.1)
.edgesIgnoringSafeArea(.all)
.animation(.default)
}
}
댓글
댓글 쓰기