Ios 如何在TAbleViewCell中实现UICollectionsVIEW?
我需要在tableViewCell中实现UICollections。如果自定义类的数组包含一些图像,我希望使用集合代替ImageView(如果不包含,则使用简单单元格) 那么,如何在手机中添加收藏演示文稿Ios 如何在TAbleViewCell中实现UICollectionsVIEW?,ios,uitableview,collections,uicollectionview,Ios,Uitableview,Collections,Uicollectionview,我需要在tableViewCell中实现UICollections。如果自定义类的数组包含一些图像,我希望使用集合代替ImageView(如果不包含,则使用简单单元格) 那么,如何在手机中添加收藏演示文稿 if (!([oneNews.images count] > 0)) { cell.cellTextLabel.text = oneNews.text; cell.cellTextLabel.numberOfLines = 0; if (
if (!([oneNews.images count] > 0))
{
cell.cellTextLabel.text = oneNews.text;
cell.cellTextLabel.numberOfLines = 0;
if ([oneNews.image length] > 0)
{
NSData *imageData = [NSData dataWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:oneNews.image]];
UIImage *image = [UIImage imageWithData:imageData];
cell.cellImageView.image = image;
}
cell.cellLikeLabel.text = [NSString stringWithFormat:@"%@", oneNews.likesCount];
cell.cellRepostLabel.text = [NSString stringWithFormat:@"%@", oneNews.repostsCount];
cell.cellCommentsLabel.text = [NSString stringWithFormat:@"%@", oneNews.commentsCount];
cell.cellDateLabel.text = [NSString stringWithFormat:@"%@", oneNews.pubDate];
} else {
//collection
}
在iOS上没有比UICollections更好的了?你是说UICollectionView吗?我在这里找到了答案,它对我很有用