We can set italics on Text
with the .italic()
modifier, but how would you set italics in a TextField
View for the placeholder text?
struct TextFieldItalics: View {
@State private var username: String = ""
var body: some View {
VStack {
Text("Hello, World!")
.italic()
TextField("Add username", text: $username)
}
}
}
CodePudding user response:
With font modifier:
.font(Font.body.italic())