uicollectionviewcell

Animate collection view cells [closed]

穿精又带淫゛_ 提交于 2019-12-18 11:14:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . How to animate collection view cells like a closing or a sliding from the left-right door in iOS. like this: 回答1: 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

Getting loaded vs visible cells on a UITableView or UICollectionView

痴心易碎 提交于 2019-12-18 11:06:49
问题 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

UICollectionViewCell with rounded corners AND drop shadow not working

岁酱吖の 提交于 2019-12-18 10:59:16
问题 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

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

十年热恋 提交于 2019-12-18 10:58:29
问题 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 ==

Resize UICollectionView cells after image inside has been downloaded

泪湿孤枕 提交于 2019-12-18 10:29:08
问题 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

UICollection View inside Table Cell does not show images in Swift 3

这一生的挚爱 提交于 2019-12-18 09:32:12
问题 I put UICollectionView inside table cell in Home page. Each category row has their contents image. But, my problem is that when I run the app, the images under second row/second category do not show whenever I run the app. The images will show after I click more button and it will goes to details UI. Then, I click on Back button and reach the Home page. At this time, the images shows properly. I tried many codes but I don't know where it is wrong. override func viewWillLayoutSubviews() {

UICollectionView display 3 items per row

柔情痞子 提交于 2019-12-18 03:36:32
问题 I have a UICollectionView created from storyboard, I want to have 3 items per row in the view. I managed to do that using the following: - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { return CGSizeMake(collectionView.frame.size.width/3.6 , (collectionView.frame.size.height-100)/2); } However, if i have 6 items, i got 2 rows with 3 items each. But when i have 4 items, it will

Achieve button click in UICollectionView

青春壹個敷衍的年華 提交于 2019-12-18 02:57:41
问题 Is there a way I can get the button click event from a button inside a UICollectionViewCell ? I used a nib to populate the collection view, the cell has the button but its action is not getting called. I think the problem is with the delegate being called. How can I fix this? How I created : Added an empty nib, created a collection view cell Added a .h and .m file and made the cell nib's files owner as the class created Wrote an action in the class. Connected the button to the action Is there

how to access from UICollectionViewCell the indexPath of the Cell in UICollectionView

妖精的绣舞 提交于 2019-12-17 22:17:59
问题 i want to animate the UICollectionViewCell when action is called. i have done UICollectionViewCell in Interface Builder , the UICollectionView also. Now i want to get the correct indexPath at my actionBtnAddToCard method. thats the way i try it now (method in ProduktViewCell.m): - (IBAction)actionAddToCart:(id)sender { XLog(@""); // see this line NSIndexPath *indexPath = ??** how can i access the correct indexPath**??; SortimentViewController *svc = [[SortimentViewController alloc]

collectionview with the horizontal scroll with mulitple section

一世执手 提交于 2019-12-17 22:12:15
问题 I want to develop the screen(objective C) like this : In this there are section names : New Games we Love New Apps We Love Both have horizontal scroll and independent to each other. My question is what is the possible way i should use to implement this from below two option. Please provide me any reference sample if available: Can i achieve the same behaviour withe single UICollectionView and having different section (dynamic). But the scroll for different section should be independent.