2013-07-23 78 views
0

我有一個畫廊頁面,我想要有12個獨特的滾動獨立的CollectionViews。這我可以做,但我也希望他們作爲一個組垂直滾動。看起來他們需要成爲一個表格。但我似乎無法得到這個工作。我正在使用故事板。所以問題是如何將一個CollectionView的輸出放入一個tableCell中,每個tableRow都擁有一個唯一的CollectionView。我想滾動我的CollectionViews horozontal和垂直。無法弄清楚如何去做

這使得collectionView滑動水平和獨立。每一個都被「標記」。現在我只需要去垂直。

- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath: (NSIndexPath *)indexPath { 

NSLog(@">>> Entering %s <<<", __PRETTY_FUNCTION__); 

if (cv.tag == 0) { 
MyCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"CELL" forIndexPath:indexPath]; 

UIImage *theImage = [UIImage imageNamed:[flowerImages objectAtIndex:indexPath.item]]; 
cell.imageView.image = theImage; 

return cell; 
} else if (cv.tag == 1) { 
MyCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"CELL2" forIndexPath:indexPath]; 

UIImage *theImage = [UIImage imageNamed:[carImages objectAtIndex:indexPath.item]]; 
cell.imageView.image = theImage; 

return cell; 
} else { 
MyCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"CELL3" forIndexPath:indexPath]; 

UIImage *theImage = [UIImage imageNamed:[birdImages objectAtIndex:indexPath.item]]; 
cell.imageView.image = theImage; 

return cell; 

    } 
} 

回答

0

好吧,我結束了使用靜態表單元格。成功了!