swift:如何显示scrollView的垂直指示器?

时间:2017-08-10 10:40:49

标签: ios swift

当用户移动到控制器而不是开始滚动时,我想显示UIScrollView的垂直指示符。就像在UITableView中一样,当用户移动到tableView时,即使用户没有开始滚动,也会自动显示垂直指示。怎么做?

4 个答案:

答案 0 :(得分:0)

您可以使用flashScrollIndicators功能。

文档:

//displays the scroll indicators for a short time. This should be done whenever you bring the scroll view to front.

答案 1 :(得分:0)

使用此代码:

self.ScrollView.showsVerticalScrollIndicator = true

确保您已正确设置UIScrollViewDelegate

self.ScrollView.delegate = self

答案 2 :(得分:0)

尝试使用[myScrollView flashScrollIndicators];

答案 3 :(得分:0)

您可以从情节提要界面启用和禁用它。

  • 垂直复选框处理垂直滚动指示器
  • 水平复选框处理水平滚动指示器

enter image description here

可以像编程方式一样设置

// For vertical scroll indicator
scrollView.showsVerticalScrollIndicator = true

// For horizontal scroll indicator
scrollView.showsHorizontalScrollIndicator = true
相关问题