适用于App Store等UITableView的范围栏? [英] Scope Bar for UITableView like App Store?

查看:134
本文介绍了适用于App Store等UITableView的范围栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何将范围栏添加到 UITableView
App Store应用程序有时会执行此操作,如下图所示。

Does anyone know how to add a scope bar to a UITableView? The App Store app does this sometimes, like in the picture below.

我想使用此范围栏为元素添加排序选项的UITableView 。这比使用带有 UISegmentControl 的工具栏更方便。

I would like to use this scope bar to add sorting options for the elements in the UITableView. This would be more convenient than having a toolbar with a UISegmentControl.

我只是不知道如何实现这个。我甚至不知道元素的名称(我称之为范围栏,因为它看起来就像 UISearchBar 的范围栏,但事实并非如此)。

I just don't know how to implement this. I don't even know the name of the element (I'm calling it scope bar because it looks just like the scope bar of a UISearchBar, but it is not).

推荐答案

元素是 UISegmentedControl ,带有 UISegmentedControlStyleBar 样式。您可以设置 tintColor 属性以获得所需的颜色。只需将视图放在表格视图上方,您就可以获得看起来像截图的内容。

The element is a UISegmentedControl with the UISegmentedControlStyleBar style. You can set the tintColor property to get the color desired. Just put the view above the table view and you can get something that looks like that screenshot.

这篇关于适用于App Store等UITableView的范围栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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