Comments (4)
Thank you for the response.
Fixing the padding solved the issue!
Thank you for the kind support, and for making the great package.
Cheers!
from customkeyboardkit.
Hi @ChurikiTenna!
Thanks so much for trying out my Swift Package! Very happy to help you out!
I quickly tried your example code (had to do some adjustments for it to compile).
In my case I don't have any issues with your example code:
struct ContentView: View {
@State private var text = "ExampleText"
var body: some View {
ScrollView {
VStack {
Spacer()
TextField("Hello", text: $text)
.useDecimalPickerStyle()
Spacer()
}
.frame(height: 800)
}
.background(Color.green)
}
}
extension TextField {
func useDecimalPickerStyle() -> some View {
self.customKeyboard(.decimalPicker)
}
}
extension CustomKeyboard {
static var decimalPicker: CustomKeyboard {
CustomKeyboardBuilder { textDocumentProxy, submit, playSystemFeedback in
DecimalPicker(handler: textDocumentProxy)
}
}
}
struct DecimalPicker: View {
let isWheel = true
let handler: UITextDocumentProxy
var body: some View {
VStack(alignment:.leading) {
HStack {
Button(action: {
}) {
Text(self.isWheel ? "キーボード入力に切り替える" : "ピッカー入力に切り替える")
.foregroundColor(Color.blue).font(Font.system(size: 18))
}
.padding()
Spacer()
Button(action: {
}) {
Text("完了").foregroundColor(Color.blue).font(Font.system(size: 18))
}
.padding()
}
.background(Color(red: 245/255, green: 245/255, blue: 245/255))
Spacer()
}
.frame(height: 300)
.background(Color.red)
}
}
Could you provide maybe example code that exactly produces your issue?
Kind regards!
Pascal
from customkeyboardkit.
Another thought,
Could maybe the padding you see be coming from the bottom of the View that contains your ScrollView/Screen?
Maybe you added a padding to the whole view to omit the home bar?
FYI, if the keyboard shows, the whole View shrinks to the size above the keyboard.
Theoretically you would see the same "error" with the standard iOS Keyboard, i.e. when not using a custom keyboard
Example:
struct ContentView: View {
@State private var text = "ExampleText"
var body: some View {
ScrollView {
VStack {
Spacer()
TextField("Hello", text: $text)
.useDecimalPickerStyle()
Spacer()
}
.frame(height: 800)
}
.background(Color.green)
.padding(.bottom, 10) //this padding potentially causing issues?
.background(Color.blue) //padding is now highlighted in blue
}
}
Would produce this unwanted blue padding:
from customkeyboardkit.
@ChurikiTenna
Awesome! Glad I could help!
Have a nice weekend!
:)
from customkeyboardkit.
Related Issues (16)
- Package Dependencies HOT 3
- Use of "\n" instead of custom onSubmitCustomKeyboard block HOT 9
- SwiftUI: Conditionally switch between custom / system keyboard HOT 4
- SwiftUI GeometryReader not Working with .customKeyboard HOT 5
- Unable to pass conditionals or state variables in/out of the custom keyboard HOT 3
- Custom keyboard does not show when axis argument is provided (iOS 16+) HOT 3
- Possibility to "relax" exact version of swiftui-introspect library? HOT 2
- [Question] playing different feedback sounds i.e input and delete HOT 2
- Performance issues with "many" custom keyboard elements HOT 15
- Only calls one 'onSubmitCustomKeyboard' HOT 6
- Modifying state during view update HOT 3
- Missing important keys HOT 2
- SwiftUI-Introspect dependency outdate HOT 4
- Add onDismiss callback when keyboard dismissed HOT 10
- Access textDocumentProxy from TextField code block HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customkeyboardkit.