[英]Swift prevent TabBar from moving up when Keyboard is active
so whenever My Keyboard toggles the Tabbar moves up with it like shown in the image.所以每当我的键盘切换时,Tabbar 就会像图像中显示的那样向上移动。 Is there a way to prevent this when the Keyboard is active?
当键盘处于活动状态时,有没有办法防止这种情况? My version is iOS 14 and XCode 12 Thanks in advance!
我的版本是 iOS 14 和 XCode 12 提前致谢!
/// Corretion: How can I modify any View in SwiftUI to prevent moving up when the Keyboard shows up? /// 更正:如何在 SwiftUI 中修改任何视图以防止在键盘出现时向上移动?
struct SwiftUIView: View {
@State var text = ""
var body: some View {
VStack{
TextField("Text", text: $text)
Text(">>Don't Move Me Up When Keyboard Is Active<<")
}
}
} }
Paul保罗
simulator view when tabbar moves up when keyboard is active当键盘处于活动状态时标签栏向上移动时的模拟器视图
尝试将以下修饰符添加到您的标签栏:
.ignoresSafeArea(.keyboard, edges: .bottom)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.