UICollectionViewController가 있고 이미 클릭 한/특정 이미지를 클릭하면 일반 ViewController로 '푸시'하므로 이미 이미지가 셀에 표시되어 있습니다. 어떻게해야합니까? 여기에 지금까지 ... 다른 뷰 컨트롤러에서 선택한 이미지를 열고 자 한 코드가xcode UICollection 다른보기 컨트롤러를 여는보기
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 1;
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [imagearray count];
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *[email protected]"Cell" ;
customcell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
[[cell nyimage]setImage:[UIImage imageNamed:[imagearray objectAtIndex:indexPath.item]]];
return cell;
}
당신이 구현해야을'collectionView : didSelectItemAtIndexPath :'와 콜렉션 뷰의 델리게이트를 설정한다. – Felix
정확히 구현 된 방법은 무엇입니까? –