Modify the Searchbar Cancel button to cancel to Chinese

Source: Internet
Author: User

At first I saw many ways on the internet that were loops, okay, I also loop

Looping when creating Uisearchbar, No.

with searchbartextdidbeginediting events to cycle, also not

No words, search the first page of Baidu is a circular, looking for half an hour, finally is to find the reason

Originally in the IOS7 after the Uisearchbar cycle needs searchbar.subviews[0] Subviews

Examples are shown below:

#begin
//
Function Description: Modify the title of the Searchbar cancel Button
Note the point:
With the IOS8 SDK, this uisearchbar is for the iOS7 (+) version, and if you want to fit iOS6, you need to match iOS6.
For example:
ios7+: for (id cc in [searchbar.subviews[0] subviews]) {}
Ios7-: for (id cc in [searchbar subviews]) {}
//
#end

I'm drunk, too. This makes the novice how to be good ah. Fortunately, finally came true. Tangled Half Day

Modify the Searchbar Cancel button to cancel to Chinese

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.