Closed Neogene closed 9 years ago
Here a log of layoutattributesforelementsinrect: which returns
(column 1 element 0): frame = (254 0; 244 379); , but is displayed with the wrong size. (column 2 element 0): frame = (254 389; 244 379); same behavior correct size but wrong displayed size.
Do you use CHTCollectionViewWaterfallCell
? This class is for demo purpose, don't use it in your project.
I don't know how you construct your collection view cell, maybe there's an imageview layout issue in it. You can try to:
Ok sorry, my mistake i use BOOL img = [UIImage imageNamed:...] using from years the knowledge 0 = NO and other values are YES, but in this case it get a random value which sometimes is evaluated as NO/YES randomly! Closing because is not an issue ! Thank you for the support.
Hi, we are facing a strange behavior:
we use two CHTCollectionViewWaterfallCell in the Storyboard, one of them uses an uiimageview, and both have different sizes.
The issue we are facing is some images aren't loaded, in other cases the size of the CHTCollectionViewWaterfallCell is not updated and uses the size of the other cell.
Inizialization:
Layout:
(void)updateLayoutForOrientation:(UIInterfaceOrientation)orientation { CHTCollectionViewWaterfallLayout layout = (CHTCollectionViewWaterfallLayout )self.collection.collectionViewLayout;
layout.columnCount = IS_IPAD? (UIInterfaceOrientationIsPortrait(orientation) ? 3 : 4):2; }
(CGSize)collectionView:(UICollectionView )collectionView layout:(UICollectionViewLayout )collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
NSDictionary *info = [self.search objectAtIndex:indexPath.row];
BOOL img = //check; return CGSizeMake(283, img?440:170); }
The size detection code is the same for both the methods, checking the existence of the image from an nsarray.
Image is set properly but seems a refresh error, we tried chaning uiimageview size and calling setneeddisplay etc.
Dragging below and going back causes the cell to be refreshed and the image displayed properly.
Regarding size the problem is also really strange.
Any help appreciated.
Attahched images of missing loaded image
1st image: the second box in the second column isn't updated regarding size. 2nd image: box without image loaded, when scrolling and going back the image is displayed.