点击键盘时文本字段移动

问题描述 投票:0回答:0

我有一个以前从未遇到过的问题。 我有一个全屏显示的带有 tableView 的 ViewController。将 0,0,0,0 约束到安全区域。

在标题视图中,我有一些图像视图和标签 - 高度是动态的,单元格(1 个原型)用于注释。单元格也有动态高度。在页脚中,我有一个文本字段和一个发送按钮。

当我单击文本字段时,键盘出现,我可以看到我正在输入的内容 - 太棒了!但只有当我不使用 iPhone 键盘时才好。在 iMac 外部键盘上打字很好 - 在模拟器键盘上打字将我的页脚视图移动到发送按钮和文本字段到视图底部。当按下 CMD + K 时,键盘消失,我可以看到我输入的内容。

有什么想法吗?

另一个注意事项:向下滚动时,标题位于时钟和电池图标下方。如何预防?

亲切的问候并感谢您提前提供帮助。

iOS -> iPhone 11 模拟器上的 15.2 Xcode 14.2 使用 InterfaceBuilder

编辑:截图

  1. top of view controller normal / unscrolled. background of clock and battery icons etc is black

  2. bottom end of view controller. the textfield and the send button are in a footer view

  3. when clicking into textfield keyboard appears but at top of view controller the image is under the clock and battery icon - it should be like users scrolls normal as in screenshot before was

  4. tapping keys on external iMac keyboard is normal - the footer with textfield and button stays on top of keyboard but when tapping keys of simulator keyboard the footer goes back to bottom

  5. after pressing CMD + K on iMac or tapping outside the keyboard view will endEditing and keyboard will disappear and user can see the written text in textfield and is able to send comment

ios swift uitableview keyboard
© www.soinside.com 2019 - 2024. All rights reserved.