Questions tagged [uicollectionviewcell]

UICollectionViewCell is a class from UIKit framework in iOS. A UICollectionViewCell object presents the content for a single data item when that item is within the collection view’s visible bounds. Available in iOS 6.0 and later which is inherited from `NSObject->UIResponder->UIView->UICollectionReusableView->UICollectionViewCell`

Cells present the main content of a collection view. The job of a cell is to present the content for a single item from the data source object. Each cell must be an instance of the UICollectionViewCell class, which you may subclass as needed to present your content. Cell objects provide inherent support for managing their own selection and highlight state, although some custom code must be written to actually apply a highlight to a cell. A UICollectionViewCell object is a specific type of reusable view that might be used for main data items.

To configure the appearance of your cell, add the views needed to present the data item’s content as subviews to the view in the contentView property.

Resource

Questions

4470 questions
1
vote
3 answers

Dynamically modifying the height of cells in a UICollectionViewCell in Objective C

I need to make a Pinterest style newsfeed. I have created a collection view with 2 columns. I am downloading the photos async in cellForItemAtIndexPath: - (UICollectionViewCell *)collectionView:(UICollectionView*)collectionView…
1
vote
3 answers

How to let the selected cell still selected when I switch the dataSource in UICollectionView?

How to let the selected cell still selected when I switch the dataSource? The gif image shows the current situation. I do not want that, when I click the switch button, if I choose the "混合", I want the "单" and "双" still selected, and back to…
s-n-2
  • 405
  • 1
  • 6
  • 24
1
vote
1 answer

UICollectionView dynamic cell overlap issue

I have created an UICollectionView horizontal scroll through programmatically. UICollectionView cell width is dynamically created based on the content. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) ->…
1
vote
1 answer

Black edges on return transition

I have implemented the following animated transition: class PopInAndOutAnimator: NSObject, UIViewControllerAnimatedTransitioning { fileprivate let _operationType : UINavigationControllerOperation fileprivate let _transitionDuration :…
ajayb
  • 633
  • 1
  • 9
  • 23
1
vote
2 answers

Change background of specific UICollectionView cells swift

I am trying to change the background of the first two cells in my collection view i have tried this code func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath)…
1
vote
1 answer

Access Firebase variable outside Closure

I'm trying to use Firebase to set the number of cells in my CollectionView. I tried to create a local variable and set that to the same value as the Firebase variable but when I try use it outside the function it doesn't work. I also tried setting…
1
vote
2 answers

Swift: Action button inside a collectionviewcell

I have a button inside a collectionview cell that I programmatically created. @IBAction func editButtonTapped() -> Void { print("Hello Edit Button") } j func collectionView(_ collectionView: UICollectionView, cellForItemAt…
juelizabeth
  • 485
  • 1
  • 8
  • 31
1
vote
1 answer

UICollectionView not displaying all of my array

I currently have a custom UICollection which loads a users video library from their camera roll. Now I am currently able to add all the videos into an array; and it prints out the correct count of videos; however my UICollection is not displaying…
AndrewS
  • 351
  • 4
  • 18
1
vote
0 answers

Dinamically adjust UICollectonViewCell size according to its content while user is typing in UITextView

I'm trying to let the user edit some UITextViews inside a vertical UICollectionView. Each UICollectionViewCell contains a single UITextView which has some random text (it can be one or many lines) and is editable. When the user edit a UITextView,…
1
vote
2 answers

How to make nine cells side by side in collection view [Xcode] [Swift 3]

I have never worked with collection view before and although there are several tutorials I didn't find the answer on my questions. I use a collection view inside a ViewController, not inside a CollectionViewController. I want to make an special…
Bla Bla
  • 21
  • 6
1
vote
0 answers

UICollectionViewFlowLayout issues with collectionview and textfields

I have an app that uses a collectionview that scrolls horizontally, and has collectionviewcells inside of it. Everything was going fine until I tried to implement a login/register cell with 2 textfields in it using textfielddelegate. When I press on…
1
vote
2 answers

Swift3 Zoom how to change UICollectionView frame size on pinch?

edit: I have updated the question code so that it now works in case it helps anyone. I have a scrollView in a UICollectionViewCell but can't get the zoom to work in the simulator with pinch. I can get this to happen by zooming the view manually but…
markhorrocks
  • 1,199
  • 19
  • 82
  • 151
1
vote
2 answers

Swift: Let a UICollectionView dynamically change its size

Target: I have a UICollectionView with default 7 columns and 6 rows of cells. Now the user shall be able to change the amount of columns and rows via a UIStepper. Like so: var numberOfColumns: Int = 7 @IBAction func changeNumberOfColumns(_ sender:…
procra
  • 535
  • 4
  • 29
1
vote
1 answer

How to change color of specific cell's label in collection view from array of labels in swift

I'm pretty new to Swift and I have a question, I have a collection view, with a cell inside, and a label inside of this cell. I created an array and returned it, so I have multiple cells with labels. My question is, how to change a color of specific…
Adley
  • 9
  • 1
1
vote
1 answer

Override method `GetSizeForItem` returns "no suitable method found to override"

I'm new in Xamarin iOS development, and I've started a CollectionView tutorial including a custom cell height. I want to change a height of the cell depending on the content of the cell (e.g., whether the cell includes a title or not). I tried to…
1 2 3
99
100