1

I have 2 cells in a group in a tableview, the first has a textview in it, (2 lines max). When the user selects the textview, the keyboard appears and moves the textview up from under the keyboard. the second cell only appears when the textview has focus.

However the second cell is still hidden by the keyboard, I have tried to the various methods that scroll the tableview, but the result is always jerky, with the table moving up and down rapidly. Probably because its inserting a row, scrolling up for the keyboard and me trying to make it scroll up even more all at once.

How can I prevent the keyboard from moving scrolling the table view at all, so that I can do the scrolling myself exactly how I want it, and avoid the ugly fight between the two methods.

Kheldar
  • 5,361
  • 3
  • 34
  • 63
Jonathan.
  • 53,997
  • 54
  • 186
  • 290

2 Answers2

1

Did you try this method by setting scroll position to UITableViewScrollPositionTop ,if this not work ,just make your second cell that with textfield :)

 - (void)scrollToNearestSelectedRowAtScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated
Andrew
  • 168
  • 5
  • It would not make sense to have the second cell as the textfield, and no matter what method I use the animation is always very jerky – Jonathan. Dec 22 '11 at 15:39
0

Use a UITableViewController instead a UIViewController (for the ViewController where your UITableView is placed). That will solve the scrolling issue.

If not possible, you have to scroll by your self (pain in the ass). See: Making a UITableView scroll when text field is selected

Community
  • 1
  • 1
Jonas Schnelli
  • 9,965
  • 3
  • 48
  • 60