【问题标题】:Mac Catalyst textview first responderMac Catalyst textview 第一响应者
【发布时间】:2020-01-15 10:10:03
【问题描述】:

当我尝试使用 Catalyst 在 Mac 上实现我的笔记应用程序时,我遇到了奇怪的界面行为。我做了textview

textView.becomeFirstResponder()

但是在我创建新笔记之后,Catalyst 以某种方式将焦点移到了后退按钮。在创建另一个 textview 焦点后,它应该会正常工作。

show image

所以它是旋转的,我不明白为什么 textView.becomeFirstResponder() 不是每次都有效。

【问题讨论】:

    标签: swift uitextview mac-catalyst uikitformac


    【解决方案1】:

    尝试在异步火箱中执行此操作

    DispatchQueue.main.async{
         textView.becomeFirstResponder()
    }
    

    【讨论】:

      猜你喜欢
      • 2020-08-24
      • 2016-10-26
      • 2017-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      相关资源
      最近更新 更多