This demo can tell you how to use  CollectionView.