-1
在我的代碼,我試圖用UIImage
& UIabel
在UICollectionViewCell
。什麼我做如果在UICollectionViewCell
沒有像我想轉移UILabel
upwards.So我用標籤的兩幀,並檢查if(UIImageView.image==nil)
它顯示效果滾動後? 怎麼辦? 這裏是我did-UILabel UICollectionViewCell在滾動後設置?
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *myCell=(UICollectionViewCell*)[self.view viewWithTag:1];
myCell = [collectionView
dequeueReusableCellWithReuseIdentifier:@"Cell"
forIndexPath:indexPath];
UILabel *label=(UILabel*)[myCell viewWithTag:12];
UIImageView *collectionViewImage=(UIImageView*)[myCell viewWithTag:11];
NSString *collectionViewImageName=[imagesCollectionViewArray objectAtIndex:indexPath.row];
collectionViewImage.image=[UIImage imageNamed:collectionViewImageName];
if (collectionViewImage.image==nil) {
[collectionViewImage setBackgroundColor:[UIColor clearColor]];
[label setFrame:CGRectMake(35, 73, 309, 54)];
label.text=[lableColectionviewArray objectAtIndex:indexPath.row];
return myCell;
}else {
[label setFrame:CGRectMake(20, 294, 352, 49)];
label.text=[lableColectionviewArray objectAtIndex:indexPath.row];
return myCell;
}
}
其刪除所有的意見...並使我的手機零... – user3422834
此後添加子菜單的內容視圖的TABLECELL –