Tag: uicollectionviewcell

UICollectionView Cell with Image, change Background with click

I have a UICollectionView with Custom CollectionView Cells. On each Cell there is a Image on it, which is as big as the whole Cell. Now i want to highlight the Cell when the User touches the Cell. First i tried it with the following delegate Methods: – (void)collectionView:(UICollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell* cell […]

Adding a UIButton to a UICollectionView cell programmatically

I have a UIViewController with a UICollectionView created inside it programmatically. I want to add a button to the cell: viewDidLoad: UICollectionViewLayout *layout = [[UICollectionViewFlowLayout alloc]init]; _collectionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:layout]; [_collectionView setDataSource:self]; [_collectionView setDelegate:self]; [_collectionView registerClass:[EMCell class] forCellWithReuseIdentifier:@”Cell”]; [self.view addSubview:_collectionView]; And then: – (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ EMCell *cell = (EMCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@”Cell” […]

how to create custom UICollectionViewCell

I have a UICollectionView and Im trying to set a label and an image in the collectionViewCell. Unfortunately I cant seem to get any labels to display or anything else for that matter. Here is my code: – (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@”cellIdentifier” forIndexPath:indexPath]; UILabel *issue = [[UILabel alloc] initWithFrame:CGRectMake(0,10,cell.bounds.size.width,40)]; […]

Poor UICollectionView Scrolling Performance With UIImage

I have a UICollectionView in my app, and each cell is a UIImageView and some text labels. The problem is that when I have the UIImageViews displaying their images, the scrolling performance is terrible. It’s nowhere near as smooth as the scrolling experience of a UITableView or even the same UICollectionView without the UIImageView. I […]

Autoresizing issue of UICollectionViewCell contentView's frame in Storyboard prototype cell (Xcode 6, iOS 8 SDK) happens when running on iOS 7 only

I’m using Xcode 6 Beta 3, iOS 8 SDK. Build Target iOS 7.0 using Swift. Please refer to my problem step by step with screenshots below. I have a UICollectionView in Storyboard. 1 Prototype UICollectionViewCell which contains 1 label in the centre (no autoresizing rule). Purple background was to mark a contentView that is generated […]

UICollectionView Vertical Paging With Code In Objective-C

I have a ViewController mycollectionview and create a UICollectionView collection view in it and set size to the frame size. I have a Custom UICollectionViewCell CollectionViewCell class. Images sizes are different and I want to just show a one cell at the same time (when not scrolling). Here is mycollectionview code : – (void)viewDidLoad { […]

UICollectionView and images

I have a UICollectionView, and it works great, but I have a doubt. In my view I have a UICollectionViewCell and inside that I have a UIImage. The cell is linked to a blank view controller, and inside that I have a UIScrollView (for managing the zoom) and a UIImage (the full-size image). I wondered […]

Load many gif to UICollectionView

I am facing problem when I download gif images and add in to collection view. gif images are download well, but when i try to scroll very very quickly it’s crash Please help. I have two solutions /* cellForGif.layer.borderColor = [[UIColor colorWithRed:54.0/255.f green:56.0/255.f blue:67.0/255.f alpha:1.0]CGColor]; cellForGif.layer.borderWidth = 0.7; FLAnimatedImage __block *gifImage = nil; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), […]

Presenting a UIPopoverController from UICollectionViewCell

I’m looking to present a UIPopoverController from a button on a UICollectionViewCell. So far, everything is created ok, but the popover isn’t visible. Is there a special way of doing this? The code works if I display it from anything else other than a collection view cell. The following code is in the UICollectionViewCell subclass. […]

UICollectionViewCell Auto Layout

I have made up a simple custom UICollectionViewCell in my storyboard, I also did this programatically with identical results. It has a singular UIImageView and two UILabels, like so: <–UIIMAGEVIEW–> <–UILABEL——–> |-(10px)- | | -(10px)- -(10px)-| <—————> <–UILABEL——–> The image is sat on the left, then to the right of it are two labels above […]