uicollectionviewcell

scrollToItem at indexPath at .top hides cell under header when sectionHeadersPinToVisibleBounds

天大地大妈咪最大 提交于 2019-12-23 13:11:45
问题 Using the following configuration: let layout = UICollectionViewFlowLayout() layout.sectionHeadersPinToVisibleBounds = true let collectionViewController = UICollectionViewController(view.bounds, collectionViewLayout: layout) The following code will scroll to the given index path but the item will be under and covered by its header: let indexPath = IndexPath(section: 0, row: 2) collecitonView.scrollToItem(at: indexPath, at: .top, animated: true) How do I get the collection view to scroll to

UICollection View causes “UICollectionViewFlowLayoutBreakForInvalidSizes” on smaller devices

蓝咒 提交于 2019-12-23 13:03:58
问题 On an iPhone 6 Plus, the collection view cells are fine, but when testing on another device size like the iPhone 5, i'm bombarded with " 017-06-15 01:59:25.744 HyperTest[3865:8825385] The behavior of the UICollectionViewFlowLayout is not defined because: 2017-06-15 01:59:25.744 HyperTest[3865:8825385] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values. 2017-06-15 01:59:25.745

collectionView:cellForItemAtIndexPath: never gets called

℡╲_俬逩灬. 提交于 2019-12-23 11:03:08
问题 I have a UICollectionView and I simply want it to show up. I have the delegate and datasource attached to the file's owner in the interface builder. collectionView:numberOfItemsInSection: Gets called just fine. I have been messing with this for a few hours and just can't figure it out... Any help would be great, Thanks in advance! Here is the full source. Sorry if its kinda messy. .h File #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "PinAnnotation.h" #import "Jot.h" @interface

collectionView:cellForItemAtIndexPath: never gets called

人盡茶涼 提交于 2019-12-23 11:02:31
问题 I have a UICollectionView and I simply want it to show up. I have the delegate and datasource attached to the file's owner in the interface builder. collectionView:numberOfItemsInSection: Gets called just fine. I have been messing with this for a few hours and just can't figure it out... Any help would be great, Thanks in advance! Here is the full source. Sorry if its kinda messy. .h File #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "PinAnnotation.h" #import "Jot.h" @interface

collectionView:cellForItemAtIndexPath: never gets called

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 11:02:04
问题 I have a UICollectionView and I simply want it to show up. I have the delegate and datasource attached to the file's owner in the interface builder. collectionView:numberOfItemsInSection: Gets called just fine. I have been messing with this for a few hours and just can't figure it out... Any help would be great, Thanks in advance! Here is the full source. Sorry if its kinda messy. .h File #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "PinAnnotation.h" #import "Jot.h" @interface

Check whether cell at indexPath is visible on screen UICollectionView

与世无争的帅哥 提交于 2019-12-23 07:27:37
问题 I have a CollectionView which displays images to the user. I download these in the background, and when the download is complete I call the following func to update the collectionViewCell and display the image. func handlePhotoDownloadCompletion(notification : NSNotification) { let userInfo:Dictionary<String,String!> = notification.userInfo as! Dictionary<String,String!> let id = userInfo["id"] let index = users_cities.indexOf({$0.id == id}) if index != nil { let indexPath = NSIndexPath

Large UICollectionViewCell disappear on scrolling

倾然丶 夕夏残阳落幕 提交于 2019-12-23 04:47:31
问题 I'm encountering the same problem as here which is that large UICollectionViewCell (more than twice of UICollectionView height apparently) disappear at a given scrolling offset and then reappear after a given scrolling offset also. I've implemented @JonathanCichon solution which is to subclass UICollectionView and perform custom action on _visibleBounds (I know it's a private API but no matter, i don't need to submit it on Apple Store) Here my custom collection view : #import "CollectionView

UICollectionView custom horizontal paging layout

最后都变了- 提交于 2019-12-23 03:41:46
问题 [![collectionview example][1]][1] I am trying to emulate this behavior using a collection view. I have started by working with this method and it has gotten me closer. Although as I swipe further and further right on my horizontal paging CollectionView, the content shifts further and further left. Also the spacing between the cells is off. I believe it requires a custom layout, but am not sure. func collectionView(collectionView: UICollectionView, layout collectionViewLayout:

Label text in UICollectionViewCell not updating

前提是你 提交于 2019-12-22 18:37:41
问题 I'm trying to change the text of a UILabel in a UICollectionViewCell after the UICollectionViewCell has loaded, when tapping a button . But the label doesn't update on the screen. The console shows that the text property of the label is updated, but it seems the label isn't redrawn with the new text. Is this a known problem with UICollectionViewCells ? Some kind of caching issue, perhaps? Do I need to reload the cell, or the entire collection view for the update to show? 回答1: Because the cell

UICollectionView cells are invisible

早过忘川 提交于 2019-12-22 09:31:06
问题 I recently added a UICollectionView to my storyboard, it's currently pushed into view by another view and this appears to be working fine however, using the storyboard editor i set the view to contain 35 cells which in the editor look fine, but when i run the app the cells are invisible. Some of the cells have UIButtons inside and these don't render either. To double check the view was rendering i changed the background colour in the editor and ran it again, the colour updated correctly. Am i