ios - 在空的 UITextView 中启用返回键

标签 ios uitextview

在我的应用程序中,即使 UITextView 为空,我也需要在 UITextView 上启用 Return Key。默认情况下,在用户未输入任何符号之前,返回键被禁用。 我该怎么做?

谢谢。

最佳答案

I need to enable Return Key on UITextView even if UITextView is empty.

实际上,无论 TextView 是否为空,返回键都默认启用。但是,如果要将返回键设置为默认禁用,则需要将 enablesReturnKeyAutomatically 设置为 YES。正如 Apple Doc 所说:

The default value for this property is NO. If you set it to YES, the keyboard disables the return key when the text entry area contains no text. As soon as the user enters any text, the return key is automatically enabled.

关于ios - 在空的 UITextView 中启用返回键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13566067/

相关文章:

iOS 键盘扩展 - 向标准键盘添加按钮(系统范围的输入附件 View )

ios - 可拖动的 UITextView

ios - 扩展 UITextView 并触发 onChange 事件的委托(delegate)

ios - UITextView:获取带有换行信息的文本

iphone - 带有两行标签的 UIBarButtonItem 宽度

iphone Mail App Popup 样式 alertview

ios - 报亭应用

ios - UITableViewCell 中的 UITextView,如何在 tableView 滚动时退出 textview 的 firstResponder?

ios4 - 我可以在 UITextView 中使用多种字体样式吗?

ios - 适用于 iOS 的 Dropbox 集成