美文网首页iOS
iOS - 输入框有值时才能点击键盘上的returnkey(en

iOS - 输入框有值时才能点击键盘上的returnkey(en

作者: Cdream | 来源:发表于2016-04-28 15:05 被阅读695次

enablesReturnKeyAutomatically属性

UITextfield、UITextView的enablesReturnKeyAutomatically属性默认是关闭的,即textField.enablesReturnKeyAutomatically = NO;
这样当输入框中没有值时,也可以点击键盘上的returnkey。

而UISearchBar的enablesReturnKeyAutomatically属性默认是开启的,即textField.enablesReturnKeyAutomatically = YES;
这样当输入框中没有值时,不可以点击键盘上的returnkey,可以手动关闭。

相关文章

网友评论

    本文标题:iOS - 输入框有值时才能点击键盘上的returnkey(en

    本文链接:https://www.haomeiwen.com/subject/jvlhrttx.html