Questions tagged [uicollectionviewcompositionallayout]
206 questions
0
votes
0 answers
How to autoscroll a specific section horizontally without affecting vertical scrolling in a collectionView using CompositionalLayout?
My collection view has several sections and the section I am having trouble with is the "메인배너" (aka mainBanner) section.
The layout of the 메인배너 section is as follows and you can think of a carousel view.
let itemSize = NSCollectionLayoutSize(
…

서승우
- 1
- 2
0
votes
0 answers
How to implement Icons and List view in my Collection View in Swift like in the Files app?
I am creating an app to store documents and I would like to apply a toggle mode for Icons and List view. I've created the the List view with UICollectionViewCompositionalLayout by using
let listLayoutConfig =…

Nikola Blazevic
- 1
- 1
0
votes
0 answers
UICollectionViewCompositionalLayout contentInsets with estimated values for its dimensions
Q: How do you apply contentInsets to a group whenever you use UICollectionViewCompositionalLayout where the axis uses estimated values for its dimension?
I have a simple app where I fetch some online data and then display the data to the user in a…

avregi
- 117
- 1
- 7
0
votes
0 answers
Height for UITableViewCell, containing UICollectionView with UICollectionViewCompositionalLayout calculated incorrectly on first load
I'm having UICollectionView with UICollectionViewCompsitionalLayout inside UITableViewCell. collectionView is constrained to the superview using SnapKit.
After updating collectionView…

ikajava
- 207
- 3
- 11
0
votes
0 answers
UICollectionViewListCell Text Indentation Using UICollectionLayoutListConfiguration UIKit
I have a section content insert of 20 left and 20 right for my UIViewController I have adjusted my separatorInsets within the UICollectionLayoutListConfiguration for this case:
var configuration = UICollectionLayoutListConfiguration(appearance:…

David Henry
- 1,972
- 20
- 43
0
votes
2 answers
UICollectionViewCompositionalLayout wrong content size
For given layout, UICollectionView always returns content size which is equal to UICollectionView size, even if items go beyond the UICollectionView.
private lazy var layout: UICollectionViewCompositionalLayout = {
let margin = 8.0
let…

dub.raf
- 1
- 2
0
votes
0 answers
Compositional layout with nested groups where groups has random count
Im trying to use a compositional layout to create random count of group like here
In other words I need to have a first group with 10 elements, second - 5 elements, third - 8 elements, for example. All elements are calculated in another business…

NyanNyan
- 51
- 1
- 9
0
votes
0 answers
I have a question about NSCollectionLayoutGroup initializers
I am creating a CompositionalLayout.
I have a question about using NSCollectionLayoutGroup initializer.
The creating layouts code is as follows.
func generateSharedAlbumsLayout() -> NSCollectionLayoutSection {
let itemSize =…

hey
- 1
- 1
0
votes
0 answers
Horizontal UICollectionViewCompositionalLayout with next cell hint
I'm experimenting with UICollectionViewCompositionalLayout and trying to achieve a similar effect to the Apple Music app, especially to the "hint" indicating there are more cells to scroll:
So far, I have managed to make a similar grid, but I can't…

Roi Mulia
- 5,626
- 11
- 54
- 105
0
votes
1 answer
UICollectionView weird layout
I'm stuck with layout issue while displaying collection view cells. All ui is done programmatically. Here's what happening while scrolling down (ui elements appearing from top left corner):
Content of cell is being laid out on the fly, can't fix…

pbuxaroff
- 41
- 5
0
votes
0 answers
Simple orthogonal collection layout, but has odd behaviour on tvOS. Not sure if it's me?
My ViewController loads and lays out correctly. This is a pretty simple layout! Works as expected on iOS, but I have weird issues on tvOS.
So - at first all looks good. But when the user scrolls down, then scrolls back to the top - the…

kric
- 114
- 5
0
votes
1 answer
How to handle different data models with collectionView compositional layout?
Im updating an app which had many collectionViews embedded inside tableview so I decided to use UICollectionViewCompositionalLayout instead. I find them very flexible and I was able to design Home page for my app using this layout.
I followed some…

Mel
- 429
- 1
- 4
- 12
0
votes
0 answers
Need to implement pagination on Collection views using Compositional layout / How to reset collectionViewLayout with new section without blinking?
I have 5 different section, 3 of them i load during initial call and the remaining 2 during scroll(pagination).
If I am creating UICollectionViewCompositionalLayout before hand then the data is getting loaded in the order NSCollectionLayoutSection…

Abhinav Jha
- 295
- 1
- 17
0
votes
0 answers
UIKit List Configuration Header Top Padding Prior To iOS 15
I am using a List Compositional Layout with my UICollectionView however I can't seem to remove the Header Top Padding prior to iOS 15. Does anyone know the fallback for this, as it's giving extra padding to the top of the section header?
CODE:
func…

David Henry
- 1,972
- 20
- 43
0
votes
0 answers
Dynamic width for center UICollectionView's item
I'm working on calendar in which I need to highlight and expand the central cell. It should looks like this:
First I tried to use a compositionalLayout with NSCollectionLayoutItem->widthDimension: .estimated(24).
Collection rendered correctly, but…

Maxim Matusevich
- 21
- 2