Passing the String to a view
// Case 1: English alphabet is no problem
test(deck: "ABCDE")
// Case 2: Font style is missing
test(deck: "アイウエオ")
// Case 3: Font style is missing
test(deck: "ABCアイウエオDE")
Result: case1
Result: case2
Result: case3
Destination view: Store the string value in a text field
struct test: View {
@State var deck : String = ""
var body: some View {
VStack {
TextField("deck name", text: $deck)
.font(.largeTitle)
.foregroundColor(Color.black)
.multilineTextAlignment(.center)
.lineLimit(1)
}
}
}
As you can see, the font style not working properly when the text field holding Japanese Characters.
Thank you very much!
It is bugged with the latest version of xCode and iOS. The problem only occurs when using a TextField
. If you use a normal Text
it works fine.
If I found a way to fix this I'll let you know. Till then you can't use a TextField
with this set of characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With