TPKeyboardAvoiding icon indicating copy to clipboard operation
TPKeyboardAvoiding copied to clipboard

How to scroll to top?

Open netwire88 opened this issue 10 years ago • 0 comments

I was able to implement TPKeyboardAvoidingTableView pretty simply by setting the Class to it. However, how do I scroll to the top of the table after making a specific cell becomeFirstResponder()?

If I set a textfield in the 1st row becomeFirstResponder(), the table scrolls all the way to the bottom. I tried this: tableView.setContentOffset(CGPointMake(0.0, -tableView.contentInset.top), animated: true)

and it doesn't work. TPKeyboardAvoidingTableView seems to have scrollToActiveTextField but I'm not sure how to use it.

netwire88 avatar Sep 13 '15 16:09 netwire88