适用于 iOS 的滑动带状 UI 控制元素以及如何模仿它?
美联社新闻的移动版有一个滑动带式 UI 控件,允许您在“头条新闻”、“最新”和任意数量的其他部分之间切换。它类似于滑动分段栏。
有谁知道如何模仿这一点?
这种类型的控件有名称吗?
The mobile edition of AP News has a sliding band type UI control that allows you to switch between "Headlines", "Most Recent" any number of other sections. It's akin to a sliding segment bar.
Does anyone know how one would go about mimicking this?
And is there a name for this type of control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 third20 库 中找到一个名为
TTTabStrip
的非常相似的控件:通过调整/样式它,你应该实现你正在寻找的东西......
You can find a very similar control named
TTTabStrip
in three20 Library :By tweaking / styling it you should achieve what you're looking for...
您也许可以在打开
pagingEnabled
的情况下使用 UIScrollView。您的控制器类将实现 UIScrollViewDelegate 协议,并在scrollViewDidScroll:
中检查滚动视图的contentOffset
以确定当前选择了哪个项目。You might be able to use a UIScrollView with
pagingEnabled
turned on. Your controller class would implement the UIScrollViewDelegate protocol, and inscrollViewDidScroll:
, check the scroll view’scontentOffset
to determine which item is currently selected.