Saj*_*jon 5 xcode ios ios-simulator swiftui xcode11
我最近从使用 Catalina beta 的 Macbook Pro 上编码 SwiftUI 改为使用 Mojave 的 Macbook Pro 10.14.6 (18G103)。
使用iPhone模拟器,每当我聚焦一个时TextField,即使是最简单的应用程序也会挂起。我无法输入任何文本,也无法聚焦另一个文本字段。
但它可以使用 iPhone设备(而不是模拟器)或使用 Catalina Beta(使用模拟器或设备)运行(应用程序不会挂起,文本字段接收输入) 。
有没有其他人有这个问题?
struct ContentView: View {
@State private var firstName = ""
@State private var lastName = ""
// Using an iOS 13 Simulator, focusing any of the TextFields below on macOS Mojave result in the app hanging. We cannot input anything and we cannot focus another textfield.
// However, this works just fine on macOS Catalina Beta `19A558d` (will upgrade to Beta 11 now)
var body: some View {
VStack {
TextField("First", text: $firstName)
TextField("Last", text: $lastName)
Text("Your name: '\(firstName) \(lastName)'")
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1881 次 |
| 最近记录: |