我实现了这样的停靠inputAccessoryView
:
lazy var inputView: UIView = {
// custom creation
}()
override var inputAccessoryView: UIView? {
return inputView
}
override var canBecomeFirstResponder: Bool {
return true
}
它的效果非常好,问题是{I}隐藏了UIViewController之后隐藏inputView
(它可见1秒钟,然后消失)。