Note that there are some explanatory texts on larger screens.

plurals
  1. POCollectionView is overlaping the cells
    primarykey
    data
    text
    <p>My aim is to have a collection view at the footer of my view. The cells are filled with photos from the photo library. I don´t know why but the cells are overlaping each other. Does anybody know why? Here is the code from the ViewController:</p> <pre><code>- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return [self.fotoArray count]; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"foto_cell"; FotoCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath]; Foto *currFoto = [self.fotoArray objectAtIndex:indexPath.row]; // Set the selectedFotoID [CoreDataManager sharedInstance].selectedFotoId = ((Foto*)[self.fotoArray objectAtIndex:indexPath.row]).objectID; NSURL *u = [NSURL URLWithString:currFoto.f_path]; [self findImage:u in: cell]; return cell; } // Get Photo from Asset Library -(void)findImage:(NSURL*)u in: (FotoCell*) cell { __block FotoCell *blockCell = cell; // ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentation *rep = [myasset defaultRepresentation]; CGImageRef iref = [rep fullResolutionImage]; if (iref) { UIImage *largeimage = [UIImage imageWithCGImage:iref]; //[largeimage retain]; UIImage *thumbnail = [UIImage imageWithCGImage:iref scale:0.15 orientation:UIImageOrientationUp]; [blockCell.fotoThumb setImage:thumbnail]; } }; // ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror) { NSLog(@"cant get image - %@",[myerror localizedDescription]); }; NSURL *asseturl = u; ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease]; [assetslibrary assetForURL:asseturl resultBlock:resultblock failureBlock:failureblock]; } </code></pre> <p>And here the Code from my Cell.m class:</p> <pre><code>@implementation FotoCell - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code } return self; } - (void)dealloc { [_fotoThumb release]; [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload