在我的应用程序中,即使 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/