修复发布动态选择图片bug

This commit is contained in:
chenshuanglin
2023-03-16 21:11:48 +08:00
parent c0d9021c28
commit 3846dd7672
2 changed files with 9 additions and 5 deletions

View File

@@ -192,7 +192,6 @@
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = UIColor.whiteColor;
_titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
_titleLabel.numberOfLines = 5;
}
return _titleLabel;
}
@@ -218,7 +217,6 @@
_nickLabel = [[UILabel alloc] init];
_nickLabel.textColor = UIColor.whiteColor;
_nickLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
_nickLabel.numberOfLines = 5;
}
return _nickLabel;
}

View File

@@ -238,7 +238,11 @@
XPMonentsPublishCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMonentsPublishCollectionViewCell class]) forIndexPath:indexPath];
UIImage * image = [self.datasource safeObjectAtIndex1:indexPath.row];
if (indexPath.row == (self.datasource.count -1)) {
cell.isShowDelete = self.datasource.count == 9;
if (image == self.addPicImage) {
cell.isShowDelete = NO;
}else{
cell.isShowDelete = YES;
}
} else {
cell.isShowDelete = YES;
}
@@ -249,7 +253,7 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (indexPath.row == (self.datasource.count -1) && self.datasource.count != 9) {
if (indexPath.row == (self.datasource.count -1) && self.originAssets.count != 9) {
[self.textView resignFirstResponder];
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self];
imagePickerVc.modalPresentationStyle = UIModalPresentationOverFullScreen;
@@ -274,7 +278,9 @@
if (indexPath.row < self.originAssets.count) {
[self.originAssets removeObjectAtIndex:indexPath.row];
}
if (![self.datasource containsObject:self.addPicImage]) {
[self.datasource addObject:self.addPicImage];
}
[self.collectionView reloadData];
if (self.datasource.count > 1) {
self.isEdited = YES;