Swift UI special training 17 SearchBar search entries, uisearchbar

Source: Internet
Author: User

Swift UI special training 17 SearchBar search entries, uisearchbar

The search bar is a simple operation in the UI. Drag a search bar.


The most important attribute in the search bar is the Placeholder, that is, the Placeholder on the right side of the graph. For example, if you enter "enter a keyword", It is shown as follows:



Set the background color:


The Options Option will make some adjustments to the search box:


For example, if we select the first item, a drop-down arrow is displayed:



Next, let's look at this part:


There are some interesting options, such as the Keyboard Type. When we enter Chinese characters and numbers on the webpage, we can only enter numbers when entering phone numbers, this option is used.

There is also the Return Key, we can open it to see:


This includes many frequently used search websites.

To perform some operations on the searched items, you only need to implement the callback method UISearchBarDelegate.

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.