Ios 我如何在目标c中移动我的单元格,使其位于顶部和右侧

Ios 我如何在目标c中移动我的单元格,使其位于顶部和右侧,ios,objective-c,uicollectionview,autolayout,Ios,Objective C,Uicollectionview,Autolayout,我不熟悉ios编程。在这里,我只想把我的手机移到右手边一点……我的顶视图也覆盖了屏幕。我想缩小屏幕的尺寸,使其与视图相适应。我如何才能做到这一点呢 - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { r

我不熟悉ios编程。在这里,我只想把我的手机移到右手边一点……我的顶视图也覆盖了屏幕。我想缩小屏幕的尺寸,使其与视图相适应。我如何才能做到这一点呢

 - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
          return UIEdgeInsetsMake(8, 8, 0, 0);
    }

使用这些代码行。它将适合你的细胞在集合中,因为你在寻找

 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
            CGFloat spaceBetweenCells = 5;
            CGFloat width = (yourMainView.frame.size.width - spaceBetweenCells) / 2;
            CGFloat height = (yourMainView.frame.size.height - spaceBetweenCells) / 2.5;
            return CGSizeMake(width, width*changeHeight+38 );
        }

根据您的要求设置“截面插图”右、左、上、下。如何设置@DixitakaBari选择“UICollectionview”并获得“显示尺寸检测器”和根据您的要求设置“截面插图”右、左、上、下。请显示您的UICollectionViewDelegateFlowLayout好吗?