开发者

Click UITableViewCell to set focus in UITextField in iPad

开发者 https://www.devze.com 2023-02-03 03:12 出处:网络
I have seen related questions asking how to set focus at startup with firstResponder, but this is a little different.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消