0

Scenario is: uitableview with multiple sections.Sections have multiple textfields in it. Now i want to properly scroll tableview on UITextfield active. i.e. whenever keyboard appears on view. There r number of solution available..such as.

[ tableView scrollToRowAtIndexPath:"name of current cell" atScrollPosition:"position to scroll" animated:YES];                                  

here let "position to scroll"=UITableViewScrollPositionMiddle. ... This is not 100% correct way,as design is not as required.

Another solution:

- (void)keyboardDidShow:(NSNotification*)aNotification
{
// Managing contentInset and scrollIndicatorInsets of UITableView here. 
}..

This is also not correct. Any suggestions?

rebello95
  • 8,486
  • 5
  • 44
  • 65
Vinod Supnekar
  • 143
  • 1
  • 7
  • you can completely move view up when keyboard appearing. – NewStackUser Jun 16 '15 at 05:16
  • yaah.i have tried that with defalut initWithStyle of tableView. In that case TextField fides scrolls but behind Section Header which is not acceptable!! – Vinod Supnekar Jun 16 '15 at 06:03
  • view i mean UIView not only table view and try putting your header in table's header view and, if possible show code along with methods what you have tried, – NewStackUser Jun 16 '15 at 06:46
  • checking the answer here http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present – pqteru Jun 16 '15 at 07:07
  • well...after some research ,i got thinks in place. txtFieldOriginInTableView=[cellLocal.txtPoints convertPoint:cellLocal.txtPoints.frame.origin toView:tableMain]; .. give me the textfields posion in Table View. and some calculation for proper scrolling done the trick!!!... Thankx to http://stackoverflow.com/a/13926438/4091144 answer by Nitin Alabur. – Vinod Supnekar Jun 17 '15 at 09:29

0 Answers0