Call emoji keyboard programmatically?

后端 未结 3 877
日久生厌
日久生厌 2021-01-11 15:33

It is possible to trigger the emoji keyboard programmatically?

I am trying to open the emoji keyboard when the user click in a button, it is possible?

相关标签:
3条回答
  • 2021-01-11 16:06

    Unfortunately this can't be done in iOS yet. Apple does not provide any public API to programatically switch to another input method. This is something the user has to change.

    0 讨论(0)
  • 2021-01-11 16:20

    We can enable the emoji keyboard from the Setting Screen.But we can’t enable the emoji keyboard programmatically in the iPhone application to input the characters in the textfield so we need to create the custom Emoji keyboard in where you have to write all emoji unicode character and call that view when Text field will tap.

    For More details to create a custom emoji view You can follow this Link

    https://mindfiremobile.wordpress.com/2014/01/17/emoji-in-iphone-and-how-to-enable-it/

    0 讨论(0)
  • 2021-01-11 16:20

    Here is answer:

    Change the iOS keyboard layout to emoji?

    After that, do follow:

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        messageTextView.keyboardType = .asciiCapable
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        messageTextView.keyboardType = .default
        messageTextView.reloadInputViews()
    }
    

    After press button call: messageTextView.reloadInputViews()

    0 讨论(0)
提交回复
热议问题