UIScrollView 有自己的点指示器吗?

发布于 2024-12-21 18:30:52 字数 601 浏览 3 评论 0原文

我有一个 ViewController,其视图包含一个 ScrollView 和一个位于底部的 PageControl。

然而,我注意到 ScrollView 已经有自己的一组 3 点指示器。因此,为了进行测试,如果我在 PageControl 栏上移动,我实际上可以看到两组点指示器。

我将 IBOutlet 设置为 PageControl,因此点会按照我的预期进行更新。但是,ScrollView 上的点不会改变(并且始终有 3 个点)。

为什么 ScrollView 已经有自己的点了?我尝试取消选中“显示水平滚动条”,但这并没有消除这些点。

我想为什么问题有两个:因为我真的只想要 PageControl,所以如何从 ScrollView 中删除点?其次,ScrollView 本身上有这些点的目的是什么?

需要明确的是,我已经在 Interface Builder 中取消选中“显示水平和垂直滚动条”。我还以编程方式禁用了它们:

scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;

提前谢谢您!

I have a ViewController with a view that contains a ScrollView and a PageControl positioned at the bottom.

What I noticed however, is that the ScrollView already has its own set of 3 dot indicators. So, just for the sake of testing, if I move around my PageControl bar, I can actually see two sets of dot indicators.

I have my IBOutlet set to my PageControl, so the dots get updated as I'd expect. However, the dots on the ScrollView don't change (and there are always 3 of them).

Why does the ScrollView already have its own dots? I tried unchecking "Show horizontal scrollers" but this did not get rid of the dots.

I guess why question is two-fold: How could I remove the dots from the ScrollView since I really only want the PageControl? Secondly, what is the purpose of having those dots on the ScrollView itself?

To be clear, I've already unchecked the Show horizontal and vertical scrollers in Interface Builder. I have also disabled them programatically:

scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

人海汹涌 2024-12-28 18:30:52

UIScrollView 没有点。也许您不小心添加了两个 UIPageControl。如果您显示更多代码,也许我们可以提供帮助,但我只能告诉您 UIScrollView 不是点的来源。

The UIScrollView does not have dots. Maybe you added two UIPageControls accidentally. If you show more code maybe we can help but all I can tell you is that a UIScrollView is not the source of the dots.

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