带有徽章或突出显示的 UISegmentedControl

发布于 2024-09-18 10:25:31 字数 177 浏览 1 评论 0原文

有时我想突出显示 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灰色世界里的红玫瑰 2024-09-25 10:25:31

我没想到还有更好的诚实方法。

最简单的方法(可能)是对 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文