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
2 answers

Swift : UICollectionView Cell can not update frame when implement sizeForItemAtIndexPath

when i implement below code : func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize{ let cellW = (ScreenWidth - 10 - 10 - 30) / 4 return…
1
vote
1 answer

Swift: numberOfSectionsInCollectionView not working?

Alright, I am having trouble with a collection view here. This is what Im trying to achieve - 1 big MAIN header and footer, then nested inside there needs to be some number (ex: 4) sections that all have just HEADERS. Like this: header…
blue
  • 7,175
  • 16
  • 81
  • 179
1
vote
0 answers

Add Corner Radius and drop shadow to UICollectionViewCell Swift 3

I'm trying to add corner radius + dropdown shadow to my UICollectionView Cell, my Cell sturcuture is like this: I added view to add shadow on it, and try to add corner radius to the to subviews: the white one and the imageview, I used the…
Rawan
  • 1,589
  • 4
  • 23
  • 47
1
vote
4 answers

Swift 3 - Reload UICollectionView inside the UITableViewCell

I have a UICollectionView inside a UITableViewCell. You may refer the image at here I would like to reload the collectionView if any update happen. I have done some research and found this : how to reload a collectionview that is inside a…
Sariyanti
  • 37
  • 1
  • 5
1
vote
0 answers

UICollectionViewCell with UIScrollView containing UIImageView, sending image to segue

I have a collectionViewCell with a UIScrollView which contains a UIImageView. In this scrollView I can zoom in and out of a picture. I want to know how I can pass the image with the state I see in to the another view controller?? class…
1
vote
2 answers

How to have one cell in a collection view with the height the same as the screen minus the nav. bar?

I am trying to make my collection view cell to cover the height of the screen without going under the navigation bar. I have got the height of the nav bar and use it to make the height of the cell. The problem is that the cell is still taller than…
1
vote
1 answer

Overlaying buttons on tableviewcell with collectionview inside

I have implemented a image slider with a UICollectionView inside a UITableViewCell which the user can slide to left and right. I want to create two buttons on this UITableViewCell so the user can also tap on that buttons to slide the images. I've…
1
vote
1 answer

UICollectionViewCell not changing colors on select

I am attempting to have a collectionView where users are able to select multiple cells, and have them highlight/deselect them. I can't seem to figure out how to even just change the background colors of the cells when they are tapped. Here is where…
1
vote
1 answer

UICollectionViewCell redrawing custom UIView sublayers with delay

I want to display something similar to the history in the Activity app, but for the sake of this question it's a simple pie diagram instead of 3 rings. I created a custom UIView and use draw(in ctx:) to draw the pie. The trouble is that when I…
Arnaud
  • 17,268
  • 9
  • 65
  • 83
1
vote
2 answers

collectionView cellForItemAtIndexPath: called twice

I have the following code:- - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{// Dequeue a prototype cell and set the label to indicate the…
j.krissa
  • 223
  • 5
  • 21
1
vote
1 answer

UICollectionViewCell Scrolling : Swift 3

I have a UICollectionViewCell that currently takes up the entire view of a (parent) UICollectionViewController; that is, there is 1 section and 1 cellatindex. I also have a textfield within this UICollectionViewCell, as a subview, along with a…
Jeeves
  • 424
  • 1
  • 7
  • 25
1
vote
0 answers

UICollectionView does not refresh in swift 3

I add UICollectionView in my app and each cell has "Delete" trash button. When I click on this button, it will show alert message to ask. After clicks on OK button, the item in Collection View will delete. However, the UI does not refresh , the item…
1
vote
2 answers

How to transition to a new controller when clicking on UICollectionViewCell (programatically)

I have set up a ViewController with UICollectionViewCells, inside of a navigation controller. I want to be able to click on the cells and then have the user be taken to a new controller depending on which cell is selected (different controller for…
1
vote
3 answers

Strange bug on dequeuing collectionviewcell

I have a calendarView made up of collectionView. It is a custom calendarView derived using mathematical calculations. The seventh row marks Saturday and it's holiday so the font color is red for the all the labels of seventh column. However, when…
amagain
  • 2,042
  • 2
  • 20
  • 36
1
vote
1 answer

Swift iOS - optimal amount of cells in collectionView

I have collectionView in my swift app, each cell is composed of a thumbnail image. Right now I have 100 cells initially, and I paginate results from my backend, so the user can click a next button to get the next 100 images, and I call…
JK140
  • 775
  • 2
  • 10
  • 19
1 2 3
99
100