TextField in Table

henkhenk

macrumors newbie
Original poster
Nov 2, 2009
10
0
hi guys

I have text filed in table. it works fine so far. but my question is when I touch inside the text field, the keyboard is overlapping with it as shown on my attached picture.

how I make the table to move a bit up when the keyboard come knowing that the text field will be covered?

I have checked out different sample codes including UICatalog it works there and its not working for me :( and I couldn't find any difference b/n there code and mind
 

Attachments

csnplt

macrumors 6502
Aug 29, 2008
320
1
Chicago Area
Try using -scrollToRowAtIndexPath:atScrollPosition:animated:

You can read more in the documentation, but basically, it will scroll to that row . If you set the scroll position to top (can't remember what the exact constant is called, but again, it's in the documentation), it will set that row at the top of the tableview, so a user will be able to edit the textfield easily. Once you're done editing (use text field delegate), you'll be able to use the same method to scroll back to the original row that was at the top.

An easier solution would be to just put the text field at a higher row on the table view, so no scrolling is needed.
 

henkhenk

macrumors newbie
Original poster
Nov 2, 2009
10
0
scroll table view

[tblview scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];

works, but it wont exactely scroll were I want to to go.

can I replace UITableViewScrollPositionTop by a number? like:
[tblview scrollToRowAtIndexPath:indexPath atScrollPosition:300 animated:YES];

tanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.