2017-05-27 61 views

回答

0

而不是使用滚动视图,你可以使用的CollectionView具有分页功能,启用滚动型..需要大量的内存,其中的CollectionView重用细胞.. 使用收集水平流布局,使细胞大小

// Objective-C的

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return CGSizeMake(CGRectGetWidth(collectionView.frame), (CGRectGetHeight(collectionView.frame))); 
} 

//Swift 
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { 
    return CGSize(width: screenWidth, height: screenWidth); 
} 

感谢

你想用`UILabel`s更换UIPageControl`的`点
相关问题