IOS Uisearchbar Learning Notes

Source: Internet
Author: User

Uisearchbar is a search control that provides a text input box, a Find button, a bookmark button, and a Cancel button. We need to use the Uisearchbardelegate agent to find work;

Drag a Uisearchbar control

Properties in the right column

Text is the default, placeholder placeholder, which is the text that is displayed when the literal is not edited, and prompt is the text that appears on the box.

The above is the text to fill in the corresponding look

Continuation properties

These two properties are used to set the style:

Used to set the button;

The four buttons correspond to each other;

We can also set the background image:

respectively is

Above is used to set the background image, the following is used to set (check the fourth button above the scope bar) background picture

Let's take a look at the agent:uibarpositioningdelegate

Editing text–searchbar:textdidchange://Call –searchbar:shouldchangetextinrange:replacementtext://when search content changes This should be replaced with the last text range –searchbarshouldbeginediting://the search box in edit state –searchbartextdidbeginediting://when the user starts to edit the text- searchbarshouldendediting://the search box to end the editing state –searchbartextdidendediting://call clicking when the user finishes editing the text buttons– searchbarbookmarkbuttonclicked://called when the user taps the bookmark button –searchbarcancelbuttonclicked://when the user clicks the Cancel button – searchbarsearchbuttonclicked://called when the user clicks the Find button –searchbarresultslistbuttonclicked://the scope button– when the user clicks the results drop-down Results list button searchbar:selectedscopebuttonindexdidchange://called when the scope button changes

Commonly used proxy methods can be seen: Click to open the link

IOS Uisearchbar Learning Notes

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: 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.