效果图
代码
struct ContentView: View {
@State private var text = ""
var body: some View {
VStack
{
TextField(
"输入框提示信息",
text: $text,
onEditingChanged: { (isChanged) in if isChanged {
print("changed")
} else {
print("unchanged")
} },
onCommit: { print("commit") }
)
}
}
}
网友评论