diff --git a/PARTagPicker/Classes/PARTagPickerViewController.m b/PARTagPicker/Classes/PARTagPickerViewController.m index cc4ecfe..be4b773 100644 --- a/PARTagPicker/Classes/PARTagPickerViewController.m +++ b/PARTagPicker/Classes/PARTagPickerViewController.m @@ -331,6 +331,9 @@ - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollection } sizingCell.tagLabel.text = tag; sizingCell.tagLabel.font = self.font; + [sizingCell setNeedsLayout]; + [sizingCell layoutIfNeeded]; + CGSize size = [sizingCell systemLayoutSizeFittingSize:CGSizeMake(collectionView.contentSize.width, TAGCOLLECTION_CELL_HEIGHT) withHorizontalFittingPriority:UILayoutPriorityDefaultLow verticalFittingPriority:UILayoutPriorityDefaultHigh]; return size; }