求教如何实现UICollectionViewCell的自适应宽度

2025-04-07 11:25:48
推荐回答(1个)
回答1:

“-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath”有: cell.layer.borderColor=CFBridgingRetain(([UIColor darkGrayColor])); cell.layer.borderWidth=0.3;