- UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 100, 30)]
- textField.returnKeyType = UIReturnKeySearch; //设置按键类型
- textField.enablesReturnKeyAutomatically = YES; //这里设置为无文字就灰色不可点
-
代理方法监听return
- (
BOOL
)textFieldShouldReturn:(UITextField *)textField{
return
YES;
}
UITextField与键盘returnSearch关联
最新推荐文章于 2022-04-03 10:35:02 发布