带有徽章或突出显示的 UISegmentedControl
有时我想突出显示 UISegmentedControl
的其中一个片段,即第三个标题是“新闻”,我想引起用户的注意。理想情况下,带有带有数字的红色徽章,如 UITabBar
上的数字 - 知道如何实现这一点吗?也请随意分享其他想法。我考虑过将徽章作为图像添加到其顶部,但也许有更好的方法。
Occasionally I want to highlight one of segments of a UISegmentedControl
, i.e. the third title is "News" and I want to draw user's attention to it. Ideally with a red badge with a number as on the UITabBar
- any idea how to achieve this? Feel free to share other ideas as well. I thought about adding the badge as an image just on top of it, but maybe there is some better way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没想到还有更好的诚实方法。
最简单的方法(可能)是对 uisegmentedcontrol 进行子类化并向其添加徽章标签。或者类似的东西。 (子类 uiview 添加一个 uisegmentedcontrol 并添加一个徽章标签)。
I wouldn't have thought there is a better way to be honest.
The easiest way will be (probably) to subclass uisegmentedcontrol and add a badge label to it. Or something similar. (subclass uiview add a uisegmentedcontrol to it and add a badge label to it).