Questions tagged [uicollectionviewflowlayout]

209 questions
0
votes
4 answers

How to keep collection view cell selected when presenting and dismissing modal view controller?

I have a UICollectionViewController that is also acts as UICollectionViewDelegateFlowLayout to size cells. One cell selection modally presents some custom controls and then returns when completed, but the selected cell is no longer selected when it…
0
votes
1 answer

UICollectionViewFlowlayout behave odd

I have an AS collection node, to my collectionFlowLayout object I gave: layout.minimumLineSpacing = 8; layout.minimumInteritemSpacing = 8; When I need to show the header and when there's only one item in the collection node, that only item becomes…
0
votes
3 answers

Pushing to new ViewController from collectionView Cell didSelectItemAt programmatically - swift

I was trying to create a simple app which implement UICollectionViewController programmatically. I have created some cells and when user clicks on particular cell should move to another controller. But i am facing problem which view is not pushing…
0
votes
0 answers

UICollectionView content view and background being different in size

What's the issue? So, I have a UICollectionView inside a UITableView which is all working alright. I'm updating the size of the collectionViewCell in the sizeForItemAt method. func collectionView(_ collectionView: UICollectionView, layout…
Ameya Vichare
  • 1,119
  • 1
  • 10
  • 22
0
votes
1 answer

layoutSubviews freezes the app when added to UICollectionView

I would like to be notified when my custom UICollectionView gets its size. It is created from xib. I've added the following function: override func layoutSubviews() { let layout = UICollectionViewFlowLayout() layout.scrollDirection =…
Luda
  • 7,282
  • 12
  • 79
  • 139
0
votes
0 answers

How to show a collectionView like this using swift 4?

Hello i want to show multiple images in collectionView just like the above image. i can show two rows and three columns with the help of UICollectionViewDelegateFlowLayout, but unable to do that. help is much appreciated. func collectionView(_…
0
votes
1 answer

Why UICollectionViewDelegateFlowLayout methods not called specifically in Portrait mode of device rotation?

I have a Collection view inside UIView. I want to auto resize the cell on device rotation(i.e there will be 4 columns in potrait mode and 5 columns in landscape mode). In the first time(when initially app launched) working fine but when I rotate the…
0
votes
1 answer

Change scrollDirection on a subclass of UICollectionViewFlowLayout

I have a collectionView that scrolls vertically. Inside the cells of that collectionView is another collectionView that I have a custom layout for. The layout is currently a subclass of UICollectionViewFlowLayout and I want the scroll direction to…
0
votes
1 answer

How to show three columns in a CollectionView using swift4 in all devices

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { if collectionView == self.collectionViewVideo { var…
0
votes
0 answers

Collectionview FlowLayout scrolling disabling issue

I have created custom class of FlowLayout for collectionview. Here is my class class NodeLayout : UICollectionViewFlowLayout{ var itemWidth : CGFloat var itemHeight : CGFloat var space : CGFloat var columns: Int{ return…
0
votes
2 answers

Constrain movement of cell in UICollectionview to bounds of the CollectionView

I'm getting some weird behavior (actually a crash) when I drag a cell outside of the CollectionView Bounds. How can I limit the user interaction of the CollectionView to only the frame of the CollectionView? When the user long-presses and drags a…
0
votes
2 answers

UICollectionViewController with Flow Layout Crash

I've just created a UICollectionViewController programatically. Up to here everything is fine but I'm facing some problems. My app immediately crashes when the CollectionViewController is called, returning this error. 'UICollectionView must be…
0
votes
1 answer

Horizontal CollectionView with dynamic height cause FlowLayout warning

I have a side-scrolling collection view that contains two images. These images may be changed by the user during runtime. This change might cause a change of the collection view cell size, hence the collection view also need to adapt its height…
PistolPete
  • 766
  • 3
  • 10
  • 25
0
votes
0 answers

CollectionViewFlowLayout Issue

when I am adding UICollectionViewFlowLayout file with collection view. collectionViewCell height is not increasing according to the collection view. it takes spacing from the top and bottom: - (void)awakeFromNib { [super awakeFromNib]; …
0
votes
1 answer

UICollectionView targetContentOffsetForProposedContentOffset: Overridden by UIScrollView

I have a custom UICollectionViewFlowLayout when I insert some items at the top I calculate the appropriate and return it from targetContentOffsetForProposedContentOffset:. The problem is on the first insertion batch updates at the top the…
1 2 3
13
14