2013-09-25 5 views
1

이 코드를 UIcollectionView에 사용하고 있는데, iOS6에서는 작동하지만 ios7에서는 작동하지 않습니다. 일단 CollectionView를 스크롤하면 오리 엔테이션 전체가 엉망이됩니다. 셀을 스크롤하는 것은 해결할 수있는 정적 셀 식별자를 제공하는 귀하의 경우처럼, 그래서 사용 재 때문에 동안 이UICollection View ios 7 호

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView 
{ 
return 1; 
} 

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 
{ 
return self.filteredNewsItems.count; 
} 

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 
{ 
NewsItemCell *cell = (NewsItemCell *)[collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath]; 
cell.autoresizingMask = UIViewAutoresizingNone; 

[cell loadWithArticle:self.filteredNewsItems[indexPath.item]]; 

return cell; 
} 

enter image description here

+0

캡쳐 화면을 제공 할 수 있습니까? –

+0

스냅 샷이 추가되었습니다. – Alex

+0

또한 스크롤 후에 만 ​​발생합니다. 그렇지 않으면 잘 보이고 지향적입니다. – Alex

답변

1

시도에 대한 모든 아이디어는 휴대가 엉망이있어

static NSString *cellIdenfier = @"collectionCell"; // this can be any string 
NewsItemCell *cell = (NewsItemCell *)[collectionView dequeueReusableCellWithReuseIdentifier:cellIdenfier forIndexPath:indexPath]; 

사용 너의 문제. 계속 문제가 지속되면

+0

글쎄요, 같은 정적 NSString * reuseIdentifier = @ "NewsItemCell"; 그래서 ios7 – Alex

+0

과 함께 작동하지 않으므로 식별자 문자열을 어디에 정의합니까? 또한 중단 점을 찍고 인쇄하면 파일 상단에 올바른 값인 –

+0

이 전역 적으로 정의됩니다. – Alex

0

loadWithArticle : 메서드는 항상 셀을 채울 때 생성 한 기존 하위 뷰를 다시 사용하지 않고 NewsItemCell에 뷰를 추가합니다. loadWithArticle에 대한 코드를 제공 할 수 있습니까?