如何在UICollectionView上始终显示滚动条 [英] How To Show Scrollbar Always On UICollectionView

查看:1141
本文介绍了如何在UICollectionView上始终显示滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我正在处理的应用程序中添加了UICollectionView到UIView。在UICollectionView中显示我有一组从Core Data中提取的图像。垂直滚动工作正常,但滚动条不会显示,直到用户触摸UICollectionView。

I have a UICollectionView added to a UIView in an app I am working on. Displayed in the UICollectionView I have a set of images pulled from Core Data. The vertical scrolling works fine but the scrollbar does not display until the user touches the UICollectionView.

如何确保右侧的滚动条始终可见,以便指示给用户它是否可滚动?

How can I make sure the scrollbar at the right is always visible so that an indication is given to the user that it is scrollable?

推荐答案

你不能让它们始终可见。相反,你可以闪现一次,当用户第一次看到集合视图通知他们时,可以滚动这个视图。

You can't make them always visible. Instead, you can flash them once, when the user is first presented with the collection view to notify them, that this view can be scrolled.

UICollectionView UIScrollView 的子类,你可以这样做:

Since UICollectionView is a subclass of UIScrollView you can do this:

[myCollectionView flashScrollIndicators];

例如,查看设置应用。当您转到比屏幕更长的设置列表时,滚动指示灯会闪烁一次。

Check out the Settings app for instance. When you go to a settings list that is longer then the screen, the scroll indicator is flashed once.

这篇关于如何在UICollectionView上始终显示滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆