Prevent the keyboard from moving the text view in UITableView

advertisements

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.


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