首页 > 解决方案 > 长按键盘时 TextField 显示 -[UIWindow endDisablingInterfaceAutorotationAnimated:] 错误 (SwiftUI)

问题描述

每当我长按 iOS 键盘中的某个键以显示备用键时,我都会收到以下错误:

2020-03-09 21:44:42.669194-0400 TestProject[10220:731641] 
-[UIWindow endDisablingInterfaceAutorotationAnimated:] called on 
<UIRemoteKeyboardWindow: 0x7ff98204fc00; frame = (0 0; 320 568); 
opaque = NO; autoresize = W+H; layer = <UIWindowLayer: 0x6000020980e0>> 
without matching -beginDisablingInterfaceAutorotation. Ignoring.

这甚至发生在一个新项目上。这是我的代码:

import SwiftUI

struct ContentView: View {
    @State var testing: String = ""
    var body: some View {
        TextField("Hello, World!", text: $testing)
    }
}

我尝试在线搜索解决方案,但每个人在尝试动态隐藏键盘时都会遇到这个问题,这不是我的情况。有谁知道我为什么会收到这个错误?

PS 我正在使用 XCode 版本 11.3.1 (11C504)。

标签: iosswiftiphoneswiftui

解决方案


这绝对不是错误。
它只是一个抛出到控制台的调试消息,您可以放心地忽略它。


推荐阅读