IOS----------Uitextfield Enable filtering of selected states pinyin

Source: Internet
Author: User

On the second day of work in 2018, he had a big pot on his back. Our project has a search function, in this version, in order to enhance the optimization, remove the filter space request, this may be able to add a good user experience, on the contrary, stealing chicken does not eclipse the rice. Did not think that the input method of the Apple system can automatically Lenovo, in the absence of the choice of Chinese characters, unexpectedly can Lenovo out a lot of smart pinyin, what??? And this kind of operation???? Lost in the I almost do not use the input method of the Apple system, my phone settings are generally the Apple's input method has been deleted, directly using Sogou. (The input method of the Apple system is too difficult to use)

Well, now look at the input before you block pinyin.

When I entered the blue sea when I did not choose the Chinese character system will automatically splice some pinyin.

Compare the printed content, have you ever felt very pleasantly surprised? How to get rid of pinyin? Add an event to the input box to filter out pinyin in the event you can try it.

_searchtextfield = [[Uitextfield alloc]initwithframe:cgrectmake (KSCREENWIDTH-40, 50)];

_searchtextfield.delegate = self;

_searchtextfield.backgroundcolor = [Uicolor Orangecolor];

_searchtextfield.placeholder = @ "Input funds, fast positioning";

_searchtextfield.returnkeytype = Uireturnkeydone;

_searchtextfield.clearbuttonmode = uitextfieldviewmodewhileediting;

[_searchtextfield addtarget:self Action: @selector (searchtextfieldchanges:) forControlEvents: Uicontroleventeditingchanged];

[Self.view Addsubview:_searchtextfield];

-(void) Searchtextfieldchanges: (Uitextfield *) textfield{

if (Textfield.markedtextrange = = nil) {

NSLog (@ "Chinese characters that appear after the Chinese characters are selected:%@", Textfield.text);

}

}

IOS----------Uitextfield Enable filtering of selected states pinyin

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.