Questions tagged [uicollectionviewflowlayout]

209 questions
1
vote
1 answer

Autoresize UICollectionView cells, Align cell to top

I've a UICollectionView, with multiple sections and rows. Header and Footer views wherever necessary, of fixed size. Cells that are autoresizable The cell view are designed like : Green colour - ImageView Orange colour - Labels with numberOfLines =…
1
vote
0 answers

Horizontal Pagination in CollectionView Like in iPhone Camera (Video/SlowMo/Photo/etc)

I have tried this solution and many others. It isn't the same as in iPhone Camera (Reference Image: https://i.stack.imgur.com/9fyFW.jpg). Center selection with pagination of one cell not by visible rows. Paging UICollectionView by cells, not…
1
vote
1 answer

Destroying scrolled Video cells in UICollectionView for TikTok-like functionality

Trying to achive a TikTok-like functionality with fullscreen video views I am relatively new to swift so please pardon me using the following player https://github.com/piemonte/Player Having difficulty destroying earlier cell instances as a result…
1
vote
0 answers

Disable auto-sizing UICollectionView based on label

I'm using UICollectionView with UIStackView. Inside UIStackView, there are several labels and images. I need layout of 2 columns in each row of UICollectionView. For cell sizing I'm using following method: func collectionView(_ collectionView:…
1
vote
0 answers

Insert Item in UICollectionView dynamically

I'm working on a requirement where I need to add the items in a UICollectionView dynamically. Here is my code of ViewController import UIKit class ViewController: UIViewController { enum Direction { case Horizonatal case…
1
vote
1 answer

UICollectionViewCell not forcing Cell Size

I am using func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: 400, height: 600) } to specify my CollectionView's…
Kashif
  • 4,642
  • 7
  • 44
  • 97
1
vote
3 answers

UICollectionView - random cells are selected

I have a Horizontal UICollectionView like the horizontal Calender in iOS. Paging is enabled but not allowsMultipleSelection. self.allowsMultipleSelection = false self.isPagingEnabled = true There are only 5 cells per page. let cellSize = …
mahan
  • 12,366
  • 5
  • 48
  • 83
1
vote
0 answers

UICollection ContentInsetAdjustment behavior modifying 'ghost' reusable view instead of my header

I am having difficulty getting UICollectionView Content Insets Adjustment Behavior setting to work. It appears to be modifying the location of 'ghost' ReusableView instead of my header view. In this screenshot the ghost view is selected, the header…
1
vote
0 answers

Cells Don't Resize On Custom CollectionView Flow Layout, Should Have Different Size Each

I am following an old tutorial about how to make a tag flow system on collection view. I have managed to display the full labels with different sizes each, but I am struggling to make the cells resize themselves. I am a beginner in Swift/Xcode so…
1
vote
2 answers

Margins around cell like in Android GridLayout

In Android it's easy to create a grid list with the next margins: I found this solution for iOS but it doesn't add margins between cell and parent view, only between cells let itemSpacing: CGFloat = 3 let itemsInOneLine: CGFloat =…
1
vote
2 answers

Remove spacing in CollectionView iOS

I am using UICollectionViewDelegateFlowLayout delegate to make it square but strange spacing is showing at the end. My Code func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,…
Dhiru
  • 3,040
  • 3
  • 25
  • 69
1
vote
1 answer

Errors when creating an IBOutlet from UICollectionViewFlowLayout from storyboard

I am trying to set an IBOutlet from my collection view's flow layout property (Which is in a collectionViewController): @IBOutlet weak var collectionViewLayout: UICollectionViewFlowLayout! however, when I connect the outlet, I get these 3…
HemOdd
  • 697
  • 1
  • 7
  • 23
1
vote
2 answers

iOS - Sticky headers with content inset - Header view is not scrolling like the cell

We tried to roll the UICollectionView like a list over the map. This is not to be confused with bottom sheet which snaps to a point (like low, mid and high). The collectionview's flowlayout property has sectionHeadersPinToVisibleBounds enabled. I…
Siddharthan Asokan
  • 4,321
  • 11
  • 44
  • 80
1
vote
1 answer

UICollectionViewController footer not re-positioning itself properly after endEditing

I have a simple UICollectionViewController that is one section with a header and footer pinned to visible bounds. When I click a textField in the footer, the footer automatically animates above the keyboard and the collectionView scrolls to show the…
1
vote
0 answers

UICollectionView header affects to prefetch items

When using UICollectionViewFlowLayout's sectionHeadersPinToVisibleBounds = true in UICollectionView, UICollectionViewDataSourcePrefetching's func prefetchItemsAt indexPaths always repeats indexPaths, like: collectionView(_:prefetchItemsAt:) [[0, 4],…