最新消息:VPS服务器又从fzhost.net换回Linode了,主题仍用朋友推荐的大前端D8

[已解决]swift输入法输入Return没有回车换行

Swift crifan 1045浏览 0评论

代码:

    func textFieldShouldReturn(textField: UITextField) -> Bool {
//        textField.resignFirstResponder()
       
//        sendMessage()
//        return true
        return false
    }

但是点击Return后,没有换行:

swift keyboard return new line

How to create a new line by tapping the return key in UITextView ios – Stack Overflow

ios – Change ‘Return’ button function to ‘Done’ in swift in UITextView – Stack Overflow

swift keyboard return key new line

swift keyboard input  new line

swift keyboard input return key

ios – Swift UITextFieldShouldReturn Return Key Tap – Stack Overflow

Swiftkey keyboard, where is the "Enter" key??? | Apple Support Communities

swift use keyboard input new line

swift keyboard input new line

ios keyboard input new line

Type Line Breaks & Enter a New Line in Messages for iOS

How do you start a new line when texting on iph… | Apple Support Communities

objective c – Add ‘Done’ and ‘New line’ buttons on keyboard in iPhone application – Stack Overflow

用Shift+Return,才能输入回车?

对了:

好像是:

此处的TextField只是单行

UITextView才是可以输入多行。。。

而此处的,Return,在去掉:

//    func textFieldShouldReturn(textField: UITextField) -> Bool {
////        textField.resignFirstResponder()
//       
////        sendMessage()
//
//        return true
////        return false
//    }

后,Return已经可以输入了。

而没有回车换行,是由于TextField只能单行的缘故。。

抽空去换成:UITextView

应该就可以,点击Return,回车了。

转载请注明:在路上 » [已解决]swift输入法输入Return没有回车换行

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
16 queries in 0.228 seconds, using 10.75MB memory