【发布时间】:2020-12-30 07:46:42
【问题描述】:
我希望 inputAccessoryView 在键盘关闭时不隐藏。我尝试在键盘隐藏时更改框架但它不起作用
customView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: 88))
customView.backgroundColor = UIColor.white
textview.inputAccessoryView = customView
// Tracking the keyboard status
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillBeHidden), name: UIResponder.keyboardWillHideNotification, object: nil)
@objc func keyboardWillHide(sender: NSNotification) {
self.customView.frame = CGRect(x: 0, y: self.view.frame.size.height-88, width: 10, height: 88)
}
【问题讨论】:
-
谢谢@BlindNinja,我太笨了。我正在尝试,非常感谢您
-
我已将其添加为答案。
标签: ios swift swift5 inputaccessoryview