Instagram Explorer的SearchBar和TableView [英] Instagram Explorer SearchBar and TableView

查看:69
本文介绍了Instagram Explorer的SearchBar和TableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几天关于UISearchBar的问题.我不了解Instagram Explorer页面的搜索栏如何工作,例如: http://imgur.com/40I38mn

I have a question for several days about UISearchBar. I don’t understand how the search bar of Instagram Explorer page works, for example : http://imgur.com/40I38mn

我的意思是,在ViewController的开头显示了searchBar,而在与该视图无关的view(tableview?)下面.当用户通过触摸搜索栏开始搜索时,将显示带有数据的右侧表格视图.

I mean, at the beginning the ViewController shows the searchBar, and below a view(tableview?) which has nothing to do with it. And when the user begins a search by touching the search bar, the right tableview with data appears.

实际上,有多个TableView吗? UISearchBar调用另一个视图?还有……简单的UISearchBar或UISearchController?我做了很多研究,测试了很多东西,甚至尝试了一个tableView.hidden = true并带有if/else条件,因此……您可以看到我对失望啊有多大.

In reality, are there multiple TableView ? UISearchBar calls an another view ? And… simple UISearchBar or UISearchController ? I made a lot of research, tested many things, I even tried a tableView.hidden = true with if/else conditions so… you can see how much i’m disappointed Ahah.

有人可以向我解释显示器的结构吗?

Someone could explain to me the structure of the display, please ?

推荐答案

它看起来是UISearchController,其搜索栏位于UICollectionView的标题内. UICollectionView是当您说与它无关"时所指的视图.

It looks to be a UISearchController whose search bar is placed within the header of a UICollectionView. The UICollectionView is the view you're referring to when you say "which has nothing to do with it".

一旦访问了搜索的UITextField,就会显示搜索功能或右表视图.此视图似乎包含UISegmentedControl.

Once the search's UITextField is accessed, the search functionality, or the right table view, then appears. This view seems to contain a UISegmentedControl.

UISegmentedControl教程应帮助您设置类似效果的选项卡. 这是过去使用.另外,您可以使用管理2个部分的UICollectionView构建非常相似的用户界面.第一部分包含您的标签&&第二个包含搜索结果列表.

A UISegmentedControl tutorial should help you setup a similar tab like effect. Here's a pretty good one that I've used in the past. Also, you could build a very similar User Interface using a UICollectionView that manages 2 sections. The first section containing your Tabs && the second containing the list of search results.

我已经为您做过一些搜索,但是我没有找到任何教程或关于如何实现它的分步指南.如果您对表视图非常熟悉,建议您尝试使用UICollectionView方法.如果没有,那么分段控制教程链接应该可以帮助您入门.

I've done some scouring for you, but I haven't found any tutorials or step by step break downs as to how you'd implement it. If you're very familiar with Table Views, I would recommend trying the UICollectionView approach. If not, the Segmented Control tutorial link should help you get started.

祝你好运,希望对你有帮助

Good luck and I hope this helps

问题似乎有助于说明如何将UISegmentedControl添加到UISearchController

It appears that this question helps depict how you would add the UISegmentedControl to the UISearchController

这篇关于Instagram Explorer的SearchBar和TableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆