博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
搜索样式键盘的Return按钮是否可点击
阅读量:4580 次
发布时间:2019-06-09

本文共 305 字,大约阅读时间需要 1 分钟。

  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

你可能感兴趣的文章