Color
is conformed to View
. So you can use it like any other View
. The issue with your code is you add cornerRadius
inside the background
modifier. It should be out like this:
TextField("Title", text: .constant("text"))
.background(Color.red)
.cornerRadius(5)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…