【问题标题】:iOS: Adding UISearchbar with filter Options in a tableviewiOS:在表格视图中添加带有过滤器选项的 UISearchbar
【发布时间】:2014-04-16 14:31:24
【问题描述】:

我对 iOS 比较陌生(来自 android 背景),我想知道如何实现并拥有像这两张图片中的搜索栏 http://i.stack.imgur.com/rQKE5.jpg 和这里(linkedin)http://i.stack.imgur.com/BnIG2.png 。想知道如何使过滤器/选项在用户点击搜索字段时动态显示并影响在uitable中显示的结果。当用户单击搜索时,会出现有关linkedin 4 过滤器的示例。我在网上搜索过,但没有找到持久的结果。同样,我想知道的是当用户点击搜索栏时如何显示这些选项/过滤器

任何帮助都非常有用,代码或示例/现有项目将非常有用。

谢谢大家

【问题讨论】:

    标签: ios uitableview uisearchbar


    【解决方案1】:

    UIKit 带有一个专用的内置搜索解决方案,与UITableViewController 结合使用,称为UISearchDisplayController。它提供了一切(尽管没有太多自定义),包括搜索栏视图、用于过滤的可选范围栏和转换。

    参考: https://developer.apple.com/library/ios/documentation/uikit/reference/UISearchDisplayController_Class/Reference/Reference.html

    编辑:

    这里有教程:http://www.appcoda.com/search-bar-tutorial-ios7/

    这是另一个包含范围栏的:http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view

    编辑:所有这些现在都已过时

    iOS8 引入了一个新的类UISearchController 来使它更干净。 见http://useyourloaf.com/blog/2015/02/16/updating-to-the-ios-8-search-controller.html

    【讨论】:

    • 我没有找到过滤可选栏的教程,请问有链接吗?
    • 还有一个带有“范围栏”的!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-08
    相关资源
    最近更新 更多