0

I'm writing an iOS application and I'm coming across a small visual bug. When the user is on a certain view controller and presses a button they are sent to the next view controller using [self.navigationController pushViewController:myViewController animated:YES]

There are two text fields and two buttons on the view controlled by the view controller. When the user is typing into one of the text fields and clicks either of the buttons the keyboard disappears downward while the view either disappears left or right.

What I want is what happens in the Notes app if the user is typing a note and clicks the left navigation bar button titled "Notes" where the keyboard leaves with the view.

  • Can you post the code for the button(s)? I get the behaviour you desire in a standard navigationController and button, without using any screenshot or adjustment. – Terence Yan Jun 21 '13 at 20:04
  • I'm pretty sure this happens automatically as long as you don't resign the first responser. – CEarwood Jun 21 '13 at 20:49

1 Answers1

0

I don't think this can be done using the normal means, but I would try this trick:

  • Take a snapshot of the keyboard before dismissing the VC

  • Then create a view or a layer with that image, and put it on top of the keyboard (this answer explains how to do that).

  • Animate the view together with the view you're dismissing.

Community
  • 1
  • 1
TotoroTotoro
  • 17,524
  • 4
  • 45
  • 76