UIScrollView有自己的点指示器吗?

时间:2022-04-11 02:03:42

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

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

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.

然而,我注意到ScrollView已经拥有了自己的3个点指示器。所以,仅仅为了测试,如果我移动我的PageControl栏,我实际上可以看到两组点指示器。

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).

我把我的IBOutlet设置为我的PageControl,所以点数会按照我的预期更新。但是,ScrollView上的点不会改变(并且总是有3个点)。

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

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

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?

我想为什么问题是双重的:我怎么能从ScrollView中删除点,因为我真的只想要PageControl?其次,在ScrollView上拥有这些点的目的是什么?

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

为了清楚起见,我已经取消选中Interface Builder中的Show水平和垂直滚动条。我也以编程方式禁用了它们:

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

Thank you in advance!

先感谢您!

1 个解决方案

#1


1  

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.

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

#1


1  

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.

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