Click UITableViewCell to set focus in UITextField in iPad
I have seen related questions asking how to set focus at startup with firstResponder, but this is a little different.
When I click on a certain UITableViewCell, I want to set the focus in开发者_如何学C a specific UITextField. Is there a way to set the focus of the UITextField in this manner?
Thanks.
You can override TouchesBegan on your custom TableViewCell to make the UITextField as the first responder
Assuming you have that cell you want then all you need to do.
[yourTextField becomeFirstResponder];
Also remember the setTags:(NSUInteger*) and viewWithTag: Methods to get cell subviews you have placed.
精彩评论