iphone - 当 UITextField 成为 FirstResponder 时得到通知

标签 iphone ios uitextfield first-responder becomefirstresponder

UITextField becomeFirstResponder 时我如何得到通知?

我可以检查 isFirstResponder 或通过 becomeFirstResponder 设置成为第一响应者

我想在用户将此文本字段设置为第一响应者时收到通知或处理事件。

谢谢。

最佳答案

您需要成为文本字段的委托(delegate)并实现这个可选的委托(delegate)方法:

- (void)textFieldDidBeginEditing:(UITextField *)textField; 

关于iphone - 当 UITextField 成为 FirstResponder 时得到通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14511862/

相关文章:

iphone - 在 iOS 上禁用输入文本颜色

安卓和 iOS : Best way to create multiple similar apps

cocoa-touch - iOS App 的非英语默认语言?

ios - 如何使用标签动态创建 UITextField (在 UITableViewCell 之上)文本值?

iphone - 在 UITextField 中禁用放大镜

iphone - 一个 Xcode 管理器中有多个证书/配置文件?

iphone - 基于 Cordova 的应用程序不是新项目的选项

ios - 临时免责声明

ios - 清除 secureTextEntry = YES 的 UITextField 时是否触发事件?

iphone - 指定 .plist 中文件的路径