如何使用界面生成器将uisearch栏添加到表视图中? [英] How to add uisearch bar to a tableview using interface builder?

查看:101
本文介绍了如何使用界面生成器将uisearch栏添加到表视图中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用interface builderuisearch bar添加到table view?

推荐答案

好吧,您不能使用界面生成器来做到这一点.

Well you can't do that using interface builder.

您需要实现UITableView的DataSource和Delegater来初始化表并将内容添加到表中,同时您可以在特定的单元格中添加UISearchBar.

You need to implement the DataSource and Delegater of the UITableView to initialize and add contents to the table and while you are doing that you can add the UISearchBar in a particular cell.

但这是一个糟糕的设计,因为用户向下滚动时将无法使用搜索选项.

But that is a bad design as such the user wont be able to use search option as he scrolls down.

因此,我建议使用IB在UITableView顶部添加UISearchBar.它很容易做到,用户也会很高兴.

so instead take my advice add UISearchBar on top of UITableView using IB. Its easy to do and the user will be happy too.

这篇关于如何使用界面生成器将uisearch栏添加到表视图中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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