How to show scrollbar always in UICollectionView

I have a UICollectionView added to a UIView in an application I'm working on. Displayed in a UICollectionView. I have a set of images extracted from Core Data. Vertical scrolling works fine, but the scroll bar is not displayed until the user touches the UICollectionView.

How can I make sure that the scroll bar on the right is always visible so that the user is told that it scrolls?

+6
source share
2 answers

You cannot make them always visible. Instead, you can scroll them once when the user is presented with a collection view first to notify them that the view can be scrolled.

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

 [myCollectionView flashScrollIndicators]; 

Check, for example, the Settings app. When you go to the settings list, which is longer than on the screen, the scroll indicator will flash once.

+10
source

FYI for Swift:

 myCollectionView.flashScrollIndicators() 
0
source

Source: https://habr.com/ru/post/945005/


All Articles