搜索样式键盘的Return按钮是否可点击

  1. UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 100, 30)]  
  2.   textField.returnKeyType = UIReturnKeySearch; //设置按键类型  
  3.   textField.enablesReturnKeyAutomatically = YES; //这里设置为无文字就灰色不可点  

效果图:

TextField内无文字,不可点击:

当TextField内有文字,按钮可点击:

原文地址:https://www.cnblogs.com/liuyingjie/p/5010644.html