2017-05-27 1 views

Antwort

0

Statt Scroll verwenden Sie können Sie verwenden Collection mit Paging-Funktion aktivieren .. Scroll viel Speicherplatz verbrauchen, wo Collection die Zelle wieder verwendet .. Verwenden Sammlung horizontale Strömung Layout und machen Zellengröße

// 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); 
} 

Dank

Verwandte Themen