简体   繁体   English

键盘出现时为什么UICollectionView偏移会发生变化

[英]Why UICollectionView offset changes when keyboard appears

I'm developing an iPad app, that has a horizontal UICollectionView . 我正在开发一个具有水平UICollectionView的iPad应用程序。 Each of the cells has a UITextField . 每个单元格都有一个UITextField When the UITextField becomes first responder, the keyboard automatically comes up, and surprisingly all the cells move upwards. UITextField成为第一响应者时,键盘自动出现,并且令人惊讶的是所有单元格都向上移动。

I haven't implemented any logic for the cells to move upwards. 我还没有为细胞向上移动实现任何逻辑。 Do you know why? 你知道为什么吗?

I haven't found any documentation regarding this, and I'm unable to fix this. 我没有找到任何关于此的文档,我无法解决这个问题。

This behaviour is implemented by Apple. 此行为由Apple实施。 The standard UICollectionView takes care for you to scroll to the correct position if a keyboard appears. 如果出现键盘,标准UICollectionView您滚动到正确的位置。 Why would you want to fix this? 你为什么想解决这个问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM