uicollectionviewcell

UICollectionView Cell + UiLabel with AutoLayout

你说的曾经没有我的故事 提交于 2019-11-30 05:06:59
I'm trying to pin an UILabel to it's parent cell. I added four constraints (top, leading, trailing, bottom) which works fine on iOS 8.0 but not on iOS 7.X . Please see image below: [Click here for full size] What am I doing wrong? Please advise! EDIT #1 It seems it's only broken since Xcode 6 GM. My approach was working fine in Xcode 6 beta 7. Moreover, if I decrease the inner view's width, it throws the following warning: 2014-09-10 19:58:28.109 Test[57827:60b] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want.

UIImageView in custom UICollectionViewCell returning nil all the time

时间秒杀一切 提交于 2019-11-30 04:43:07
OK in my story board I have made a UICollectionView with 3 cells. One of the cells I made a custom class for that obviously extends the UICollectionViewCell: And I registered the class in my ViewDiDApear: [self.collectionView registerClass:[DeviceImageCell class] forCellWithReuseIdentifier:@"Cell1"]; Also I have added an imageView to that specific cell and an outlet for that imageView in my custom class. Problem occurs when I make my custom cell it forgets everything that was set in my storyboard, aka the background color, where my image view is and so on. Because of this my imageView returns

UICollectionView horizontal continuous loop

可紊 提交于 2019-11-30 03:27:24
问题 So I have a UICollectionView with custom UIViews for each cell. The UIView takes up the whole screen and you can horizontally navigate to each of the 4 different UIView/cells. This all works fine and uses a pager to indicate which page of the collectionview you are on. I have looked around google and the like to see if I could get it to loop back to the beginning after you navigate passed the last cell. So for example: I start at the 3rd cell, navigate to the 4th, then when i swipe to the

Animate collection view cells [closed]

妖精的绣舞 提交于 2019-11-30 02:32:22
How to animate collection view cells like a closing or a sliding from the left-right door in iOS. like this: This is code for animation collection view cells like a closing door. This collection has 2 columns. I have added code for UICollectionViewDelegateFlowLayout methods for collection view cell sizes. You can customize it or change it as per your requirement. This code shows a simple way to generate animation like a closing door. // MARK: - UICollectionViewDelegateFlowLayout extension SettingsViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView:

Swipe Animation for remove Cell in UICollectionView - Swift 2.0

我怕爱的太早我们不能终老 提交于 2019-11-30 02:26:01
I created an app with UICollectionView like this image: Added two gestures: The first (up) will erase the cell. The second (down) will update the cell (take new data of CoreData). The functions work fine, but there's no animation. iOS has a very cool animation dragging the cell up and the cell disappears. I am a beginner in animations swift, so I'm a little lost when it. My question is: How can I add an animation that takes up the entire cell? I read some answers on the site, but all in Object-C ( like this ). Can someone help me? The best way to achieve the animation on the cell of

Getting loaded vs visible cells on a UITableView or UICollectionView

南笙酒味 提交于 2019-11-30 01:51:05
With the introduction of iOS 10, it seems like we're going to have prefetching enabled by default on UITableView and UICollectionViews . This means that cells that aren't displayed on the screen are going to be fetched before the user actually sees them. Here are some relevant methods: UITableView : cellForRowAtIndexPath: : returns " nil if the cell is not visible." visibleCells : each item represents "a visible cell in the table view." indexPathsForVisibleRows : each item represents "a visible row in the table view." UICollectionView : visibleCells : "returns the complete list of visible

how to get indexPath for cell which is located in the center of UICollectionView

不问归期 提交于 2019-11-30 01:44:36
How can i find indexPath for cell in the middle of UICollectionView ? I have horizontal scrolling and only one big cell is visible (partially two other cell s on the sides are visible as well). I need to delete cell located in the center (means - current cell ) without touching it. Only pressing "Trash" button and confirm Delete. But now it delete only first cell s. - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex == actionSheet.destructiveButtonIndex) { initialPinchPoint = ???????? self.tappedCellPath = [self.collectionView

UICollectionViewCell with rounded corners AND drop shadow not working

这一生的挚爱 提交于 2019-11-30 00:24:19
I want my UICollectionViewCells to have rounded corners and drop shadows but I have run into a problem where it seems I can only have one or the other, but not both. To just round the corners I use this code in the initialization of the cell: CALayer *layer = [self layer]; [layer setCornerRadius:4]; [layer setRasterizationScale:[[UIScreen mainScreen] scale]]; [layer setShouldRasterize:YES]; To just add a drop shadow I use this code in the initialization of the cell: CALayer *layer = [self layer]; [layer setMasksToBounds:NO]; [layer setRasterizationScale:[[UIScreen mainScreen] scale]]; [layer

How can I create Infinite Scrolling in UICollectionView for iOS Objective-c

烂漫一生 提交于 2019-11-29 23:21:55
问题 How To Create Infinite Scrolling in my UICollectionView ? attached screenshot : Now my NSArray is NSArray* nameArr = [NSArray arrayWithObjects: @"0", @"1", @"2", @"3", @"4", nil]; I want to create an Infinite Scrolling in collectionView After Complete array repeat all cells again and again. Left and Right both side required to scroll Infinite. If yes, then how can I implement please give a reference in objective-c. Thanks!!! In advance 回答1: First thing replace your current NSArray with

Resize UICollectionView cells after image inside has been downloaded

给你一囗甜甜゛ 提交于 2019-11-29 21:54:36
I'm building a UICollectionView and my custom cells will contain two labels and one image. Each image is downloaded asynchronously so I don't know it's size until the download it's complete. Once is downloaded, I want to adapt each cell to re-layout it's content and frame to fit in height the image just downloaded. As UICollectionViewLayout , I'm using CHTCollectionViewWaterfallLayout To download the image asynchronously I'm using SDWebImage , like this: [cell.imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] placeholderImage:[UIImage imageNamed:@