Skip to content

Commit 501e363

Browse files
authored
Merge pull request banchichen#1663 from coderAs7/master
修复会出现两个noDataLabel的问题
2 parents 7a23cde + 8c52eac commit 501e363

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ - (void)configCollectionView {
204204

205205
_collectionView.contentSize = CGSizeMake(self.view.tz_width, (([self getAllCellCount] + self.columnNumber - 1) / self.columnNumber) * self.view.tz_width);
206206
if (_models.count == 0) {
207+
if (_noDataLabel) {
208+
[_noDataLabel removeFromSuperview];
209+
_noDataLabel = nil;
210+
}
207211
_noDataLabel = [UILabel new];
208212
_noDataLabel.textAlignment = NSTextAlignmentCenter;
209213
_noDataLabel.text = [NSBundle tz_localizedStringForKey:@"No Photos or Videos"];

0 commit comments

Comments
 (0)