ios - UICollectionView doesn't display any image -
I am trying to display the image from the document directory in the UICollectionView, everything is fine but no image is visible. cell.backgroundColor = [UIColor redColor]; With this piece of code, the correct UICollectionView displays UILabel, but no image is displayed. I use the code to store my image in listeImageView. Image. Here are the results of my NSLog: You are below, / P> < Previous> But your is doing, Why not use your listeImageView below: - This should take you an image. UPDATE : - - View (zero) viewsDidload {[Super Viewedload]; // Start Recipe image array NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, yes); NSString * document directory = [path item overindexx: 0]; NSArray * dirContents = [[NSFileManager Default Manager] Contentoff DirectoryAct Path: Document Directory Error: Zero]; NSMutableArray * image = [NSMutableArray array]; (For dirContents in NSString * tirring) {if ([tString hasSuffix: @ ". Png"]) {[image addObject: tString]; ListeImages = [NSArray arrayWithArray: image]; }}} - (NSInteger) collectionView: (UICollectionView *) collectionView NumberOffAd Insights: (NSInteger) section {return listeImages.count; } - See the (UICollectionViewCell *) collection: (UICollectionView *) collectionView cellForItemAtIndexPath: (NSIndexPath *) index path {static NSString * identifier = @ "cell"; UICollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier: identifier forIndexPath: indexPath]; UIImageView * listeImageView = (UIImageView *) [cell visualization: 100]; UILabel * LabelView = (UILabel *) [cell view details: 110]; LabelView.text = [listeImages objectAtIndex: indexPath.row]; ListeImageView.image = [UIImage imageNamed: [listeImagesObjectAutandx: indexPath.row]]; NSLog (@ "List UIImageView listeIgeView.image% @", listeIgeView.image);
Cells. Background view = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "photo frame .png"]]; NSLog (@ "List NSArray * liste images% @", list images); Cell.tag = indexPath.row; Return cell; }
UIImageView * listeImageView = (UIImageView *) [Cell ViewViewGuet: 100]; ListeImageView.image = [UIImage imageNamed: [listeImagesObjectAutandx: indexPath.row]];
2014-10-11 09: 46: 31.117 imgap [2803: 60b] List NSArray * ListeImages; ("Image10102014233607.png", "image10102014233616.png", "image10102014233627.png") 2014-10-11 09: 46: 31.158 IMGAPP [2803: 60b] List UIIMAge listIIMAJEWIs (empty) 2014-10-11 09: 46: 31.171 IMGAPP [2803: 60B] List UIIMAgeVision listImageViIiIs (empty) 2014-10-11 09: 46: 31.178 IMGAPP [2803: 60B] List UIIMAGEView listImageViIiIs (empty)
listeImageView.image = [UIImage imageNamed: [listeImages objectAtIndex: indexPath.row]];
cell. Background view = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "photo-frame.png"]];
cell.backgroundView = listeImageView;
For
(in NSString * tString DirContents) {if ([tString hasSuffix: @ ".png"]) {** [Image addObject: [UIImage imageWithContentsOfFile: tString]]; // Do the bottom line as if you were unable to create an image object, which you are trying to achieve. Also check your image array for ** // object, whether it is stored or not. // [image addObject: tString]; }} ListeImages = [NSArray arrayWithArray: image]; // After adding all the objects to your image mutable and do so, not for the loop, because it will start a lot depending on the number of your loop running.
Comments
Post a Comment