相关疑难解决方法(0)

SwiftUI TextField with formatter not working?

I'm trying to get a numeric field updated so I'm using a TextField with the formatter: parameter set. It formats the number into the entry field just fine, but does not update the bound value when edited. The TextField works fine (on Strings) without the formatter specified. Is this a bug or am I missing something?

UPDATE: As of Xcode 11 beta 3 it kind of works. Now if you edit the numeric TextField, the bound value is updated after …

swiftui

15
推荐指数
4
解决办法
2778
查看次数

标签 统计

swiftui ×1