4

I'm developing an iPad app, that has a horizontal UICollectionView. Each of the cells has a UITextField. When the UITextField becomes first responder, the keyboard automatically comes up, and surprisingly all the cells move upwards.

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.

Fabio Berger
  • 1,921
  • 2
  • 24
  • 29
user1447414
  • 1,306
  • 2
  • 12
  • 25

1 Answers1

0

This behaviour is implemented by Apple. The standard UICollectionView takes care for you to scroll to the correct position if a keyboard appears. Why would you want to fix this?

Fabio Berger
  • 1,921
  • 2
  • 24
  • 29
  • 1
    Because the animation is not the one we want. i need to customise the animation. Can I do so? – user1447414 Dec 15 '15 at 12:28
  • @user1447414 I'm not sure if you can. See here something similar, maybe this approach helps you: http://stackoverflow.com/questions/4585718/disable-uiscrollview-scrolling-when-uitextfield-becomes-first-responder – Fabio Berger Dec 15 '15 at 12:54
  • @FabioBerger: Is this behaviour even applicable for UITextView? – Anoop Nyati Jul 07 '17 at 08:12
  • @AnoopNyati Yes it should, since this behaviour is controlled by the UICollectionView, and not the UITextField. – Fabio Berger Jul 07 '17 at 08:54