gpt4 book ai didi

ios - 偏移 UITextField - 表情符号布局

转载 作者:行者123 更新时间:2023-11-28 12:50:15 26 4
gpt4 key购买 nike

只要键盘处于事件状态,我就会尝试偏移 UITextField,效果很好,直到我尝试了表情符号布局。有没有办法检测键盘输入的类型,以便找出高度差?谢谢 enter image description here

最佳答案

不是使用 UIKeyboardDidShowNotification/UIKeyboardDidHideNotification 观察者,而是使用 UIKeyboardWillChangeFrameNotification 观察者,每个事件都会触发:键盘隐藏,键盘显示和键盘变化框架。

像这样:

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardAction), name: UIKeyboardWillChangeFrameNotification, object: nil)

关于ios - 偏移 UITextField - 表情符号布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36735081/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com