Bug resolution record on iOS default Chinese Input Method garbled, iosbug

Source: Internet
Author: User

Bug resolution record on iOS default Chinese Input Method garbled, iosbug

When I write a Blog for the first time, I will record a problem that occurred in the project today.

In a text box, convert it to a Chinese input method, and then start the input,

Click "Post" and submit the data to the background. The result is displayed? Garbled issues, such:

This problem plagued me for a while. Later I found that when I entered Chinese, it seemed to be selected. when I switched the focus, the input box would convert the input to English, so I thought about canceling the selected solution when I click "Post", and record it here, so that I don't know how to deal with the same problem in the future:

UITextRange * textRange = [self. textView textRangeFromPosition: self. textView. Adjust toPosition: self. textView. beginningOfDocument]; [self. textView setSelectedTextRange: textRange]; [self. textView details];

 

 

Directly use UITextRange to set the cursor to the initial position. In this way, the text box will automatically convert the unfinished Chinese characters into English and write them into the text box.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.