I am encountering a difficulty in SwiftUI when utilizing a customized font in a TextField with the axis property set to .vertical. Particularly, there’s additional area on the backside of the textual content within the TextField. This drawback doesn’t happen when the axis is about to .horizontal, nor does it happen when utilizing the system font.
Right here is my code:
VStack(spacing: DSConstants.Spacing.spacing16) {
Textual content("Axis: Horizontal")
TextField("", textual content: $textual content, axis: .horizontal)
.font(.customized("RakutenSansJP-Common", dimension: 14))
.body(minHeight: 44)
.centered($modifying)
.padding(.horizontal, 16)
.padding(.vertical, 4)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Shade.white)
)
.overlay(
RoundedRectangle(cornerRadius: 16)
.stroke(modifying ? Shade.blue : Shade.grey, lineWidth: 1)
)
.centered($modifying)
Textual content("Axis: Vertical")
TextField("", textual content: $textual content, axis: .vertical)
.font(.customized("RakutenSansJP-Common", dimension: 14))
.body(minHeight: 44)
.centered($modifying)
.padding(.horizontal, 16)
.padding(.vertical, 4)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(Shade.white)
)
.overlay(
RoundedRectangle(cornerRadius: 16)
.stroke(modifying ? Shade.blue : Shade.grey, lineWidth: 1)
)
.centered($modifying)
}
Display screen shot:
Has anybody else encountered this situation or have any strategies on find out how to resolve it?