Làm thế nào tôi có thể nhận được hai cột trong một UICollectionView mà mất toàn bộ không gian mà không cần bất kỳ lợi nhuận hoặc lỗ hổng giống như những bức tranh tôi vẽ dưới đây: Hai cột trên một uicollectionview
tôi đã cố gắng sử dụng đoạn mã sau:
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(160, 160);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
return 1.0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
return 1.0;
}
nhưng có kết quả này:
Thay đổi này kích thước một cái gì đó thấp hơn (như 100). Ngoài ra, bạn có thể làm điều này trong bảng phân cảnh bằng cách thêm một mẫu thử nghiệm khác. –
vì vậy mọi giải pháp chưa? – xeravim