1.0.1
This project is only for SwiftUI
When View uses ignoresSafeArea or edgesIgnoringSafeArea(.bottom)
ignoresSafeArea
edgesIgnoringSafeArea(.bottom)
this framework can be used because TextField and TextEditor cannot make the keyboard bounce
TextField
TextEditor
Encapsulated UITextView, UITextField can also be used
UITextView
UITextField
@State private var text: String = "" var body: some View { VStack { Spacer() KeyboardHost { TextField("please enter text", text: $text) .frame(width: 200, height: 40, alignment: .center) .padding(.bottom, 20) } } .ignoresSafeArea() }
You can add KeyboardHost to an Xcode project by adding it as a package dependency.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
KeyboardHost
This project is only for SwiftUI
When View uses
ignoresSafeAreaoredgesIgnoringSafeArea(.bottom)this framework can be used because
TextFieldandTextEditorcannot make the keyboard bounceEncapsulated
UITextView,UITextFieldcan also be usedSupported Platforms
Usage
Installation
You can add KeyboardHost to an Xcode project by adding it as a package dependency.