我有一個自定義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]];
,但我沒有看到任何東西,只是白色的邊框。不知道我在搞什麼。任何指針都會有幫助。
我遇到這種行爲也是如此。 – Kyle