2012-11-11 53 views
3

我有一個自定義CollectionViewCellUICollectionViewCell不顯示任何

@interface FBPicCell : UICollectionViewCell 
@property (strong, nonatomic) IBOutlet UILabel *picby; 

在我的代碼中viewDidLoad

[self.fbpiccollectionView registerClass:[FBPicCell class] forCellWithReuseIdentifier:@"fbpiccell"]; 

cellForItemAtIndexPath功能

FBPicCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"fbpiccell" forIndexPath:indexPath]; 
cell.backgroundColor = [UIColor whiteColor]; 
[cell.picby setText:@"Pavan"]; 
[cell.picby setTextColor:[UIColor redColor]]; 

,但我沒有看到任何東西,只是白色的邊框。不知道我在搞什麼。任何指針都會有幫助。

+0

我遇到這種行爲也是如此。 – Kyle

回答

1

我有同樣的問題,在註冊您的通話 註冊筆尖以及原樣

[collectionView registerNib:[UINib nibWithNibName:@"cellname" bundle:nil] forCellWithReuseIdentifier:@"cellname"]; 

沿着這爲我工作 問候

+0

是的,註冊筆尖的作品,由於某種原因註冊類不.. –

+0

如果你認爲這有幫助請回答投訴 – Nitesh

+0

謝謝!這讓我瘋狂。我使用iOS8在Xcode6.1上,registerClass不起作用 – ArdenDev