Questions tagged [uicollectionview]

The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts. Collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and many more. Available in iOS 6.0 and later

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

N x M UICompositionalLayout with estimatedWidth for each cell

I'm trying to create this section of the UICollectionView from X when you try to configure your interests. All 3 rows scroll as a together as a group. Here a picture: Each item has an estimatedWidth ...
Unbound's user avatar
  • 17
0 votes
0 answers
38 views

The selection of the cell in a collectionview is not working vertically with scrollToItem:

When I use this code, it works well for the horizontal position, but not for the vertical position. The horizontal position is always good, the vertical is random. How to position on the exact cell? ...
ΩlostA's user avatar
  • 2,541
0 votes
0 answers
17 views

Get registered classes and kind for supplementary views in UICollectionView

I am working on a generic UICollectionViewLayout that defines the layout attributes for both items and supplementary views. my implementation for func layoutAttributesForElements(in rect: CGRect) ->...
Crocobag's user avatar
  • 2,270
0 votes
0 answers
16 views

How can I make different scroll shape for collectionviewcells in the same CollectionViewController

I am using 3 different CollectionViewCells in UICollectionViewController. I don't want any scroll feature for the 1st cell. I want the 2nd cell to move horizontally. For the 3rd cell I want it to move ...
HBK's user avatar
  • 7
0 votes
0 answers
19 views

Issue with UICollectionViewCompositionalLayout, items scrolling above the decoration background

I am developing an iOS app in which I am trying to use compositional layout to design a screen . I am facing a weird issue now in designing. Following is the UICollectionViewCompositionalLayout I am ...
MobX's user avatar
  • 2,650
0 votes
1 answer
60 views

How to Pause the video when scrolling and Play a video when cell is visible on the screen Swift

I have a table view cell for vertical listing and have added a collection view in a horizontal playlist. I want to implement video playback similar to the YouTube app. Specifically, I aim to have the ...
Sham Dhiman's user avatar
  • 1,386
0 votes
0 answers
24 views

[<UICollectionViewCell 0x14fd06a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

I've been getting the error message "[<UICollectionViewCell 0x14fd06a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key" for an image attached to ...
Jobalisk's user avatar
  • 726
-1 votes
1 answer
64 views

prevent cell stacking in UIcollectionView

I've been working on a collection game using apple maps in Objective C. Each item you collect appears in a uicollectionview. it works perfectly fine until you get around 15 or so and have to start ...
Jobalisk's user avatar
  • 726
0 votes
0 answers
28 views

Lazy Loading UICollectionView Sections

I have a collectionView which uses UICollectionViewCompositionalLayout. It has 150 Sections and each section can have a random number of items (up to 30) depending what comes back from the API. I've ...
K. Janjuha's user avatar
0 votes
1 answer
44 views

CollectionView cells inconsistently showing checkbox when entering editing mode

I'm facing an issue with my UICollectionView when entering editing mode. The problem is that when I scroll down, some cells appear with checkboxes, while others don't. However, I want all cells to ...
Aditya Vyavahare's user avatar
1 vote
0 answers
87 views

UICollectionView.scrollToItem(at:at:animated:) scroll the section out of view on IOS 17

I found that sometimes call UICollectionView.scrollToItem(at:at:animated:) would scroll to a weird place on IOS 17 device and Mac OS 14 with Xcode 15, It's ok on below IOS 17 device (IOS 16...). Here ...
Austin Huang's user avatar
-1 votes
2 answers
45 views

Correctly create uicollection view in iOS using Objective C

I've been trying to get a collection view working properly in iOS. I've been following this question: how to create custom UICollectionViewCell I think I have most of it correct, I'm using the ...
Jobalisk's user avatar
  • 726
0 votes
0 answers
21 views

Single row CollectionView with UICollectionViewDelegateFlowLayout and constraints

I would like to have a single row collection view at the bottom of the screen with a text field on top of it. Red rectangle is the text field and the green one is the collection view. This is my ...
smeshko's user avatar
  • 1,194
-2 votes
0 answers
18 views

How can I use collectionView to achieve the same layout as keyboard candidate words?

How can I use collectionView to achieve the same layout as keyboard candidate words? The number of items in each row is uncertain. A maximum of six items can be placed. If they cannot be placed, they ...
zhanggen's user avatar
1 vote
1 answer
33 views

How to add edge insets to UICollectionView's contentView when using UICollectionViewCompositionalLayout of type .list

I have the following problem: I want to add horizontal insets to a collectionView's contentView, but when I set the contentInset to UIEdgeInsets(top: .zero, left: 64, bottom: .zero, right: 64) for ...
schmittsfn's user avatar
  • 1,442
1 vote
1 answer
41 views

How to use several types of cell in UICollectionViewCompositionalLayout?

I have a self-written library with UICollectionViewCompositionalLayout and different 4 cell. I want to use this library in my new project with UICollectionViewCompositionalLayout. And I only want to ...
User's user avatar
  • 133
0 votes
0 answers
25 views

iOS UITest passes locally but fails on Bitrise

I have a supposedly straightforward UITest that I want to write. I have a collection view and I want to scroll to the end of the collection view. Along the way, I want to count specific elements / ...
Shawn Frank's user avatar
  • 4,515
1 vote
1 answer
48 views

UICollectionViewCompositionalLayout Collectionview cell width not resizing properly after reloading data

I Am using UICollectionViewCompositionalLayout to create dynamic width, fixed height, tag cell type of layout in some sections of my collectionview. When i add a new string to an array in my database, ...
caa5042's user avatar
  • 177
0 votes
2 answers
154 views

.net MAUI DataTemplate with a CollectionView that contains <ContentPresenter /> in its ItemTemplate, "No installed components were detected"

We have a number of Views that display a list of Models and in each of those views, tapping on an Item displays an action sheet. Everything is working well but we want to utilize the ControlTemplate ...
dpTech's user avatar
  • 29
0 votes
0 answers
26 views

How to get indexpath.row insde insetForSectionAt to give different size for different indexpath.row

import UIKit class ViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! var arrayInt = [0,1,2,3,4,5,6,7,8] override func viewDidLoad() { ...
DSR's user avatar
  • 1
0 votes
0 answers
25 views

Adjust button width to fit any text in a collection view

So my problem is that I have a collection view where I list the product categories. I want to fit the text with different widths into the button. I played around with the constraints a bit and that's ...
Mostafa Hendawi's user avatar
0 votes
1 answer
82 views

How to implement custom paging on UICollectionView to make it appear like the one in the AppStore?

I want to implement paging in the UICollectionView to make it appear like the AppStore The previous and next cells should be partially visible from leading and trailing edges. I want to give it a feel ...
Aditya Vyavahare's user avatar
1 vote
1 answer
23 views

Center a UIView without affecting the position of other UI classes in UIKit programmatically

I want to move the position of a UIView boardGame: UICollectionView to be on the center of the screen by modifying the constraints properties such as topAnchor, but anything I do to it seems to affect ...
willd's user avatar
  • 139
0 votes
0 answers
24 views

Custom UIDragPreview's position relative to drag touch

I am trying to provide a custom UIDragPreview when user drags an item from my UICollectionView. It works but shifts the preview down resulting in user holding the dragged preview from the top. Default ...
Kashif's user avatar
  • 4,450
0 votes
1 answer
100 views

Maui syntax to use converter inside of a C# method

What I'm trying to accomplish In a CollectionView, I display a list of objects. In each display there's a checkbox next to it. Ideally, when the user checks or un-checks the checkbox I go into a ...
Bob's user avatar
  • 81
0 votes
1 answer
101 views

Multiple calls to scrollToItem(at:at:animated:) in quick succession causes scrolling glitch in UICollectionView

In my setup I have a horizontal collection view with chip style, on initial load the first chip is selected by default and corresponding to the chip an API call is made and it's data is loaded into a ...
Nikhil Muskur's user avatar
0 votes
1 answer
74 views

Customizing corner radius & colors for UICollectionView sections in Compositional Layout?

I am working on a project where I am using UICollectionView with a compositional layout. I am trying to add corner radius to the section headers of my UICollectionView. I am using ...
Shivaditya kr's user avatar
0 votes
0 answers
148 views

iOS UICollectionView crash - NSInternalInconsistencyException reason Invalid batch updates detected

I'm trying to update the collectionview after a network call to insert more elements into the collectionview. There is only one section (section 0). The crash was very hard to reproduce and I can't ...
DesperateLearner's user avatar
0 votes
1 answer
48 views

UICollectionView resets focus when reloading data after presenting another VC

In certain conditions, on tvOS, a collection view will reset its focus on reloadData(). Below is the smallest amount of code that reproduces the problem. import SwiftUI @main struct DemosApp_tvOS: ...
Cristik's user avatar
  • 31.5k
0 votes
0 answers
46 views

Implementing UICollectionView with multiple sections

I'm just learning the Swift. I don't know how to implement the required design in Figma, there’s a problem with the buttons for selecting a schedule and category, I’m trying to change the background ...
ruslaniOS's user avatar
0 votes
0 answers
50 views

How can I get DevExpress CollectionView's Selected Rows Properly in Xamarin Forms?

I'm using devExpress CollectionView to show data : <dxcv:DXCollectionView ItemsSource="{Binding ReportsParameters}" DisplayMember="VIEW_QUERY" ...
Mert Altiparmak's user avatar
0 votes
1 answer
32 views

Display Items Side by side on iPad using UICollectionViewCompositionalLayout

My intention is to display the items side by side on iPad and line by line in iPhone. My code as bellow but for some reason Im getting the layout wrong. Any help would be much appreciate. What I get ...
danu's user avatar
  • 1,098
0 votes
1 answer
227 views

'horizontal(layoutSize:subitem:count:)' was deprecated in iOS 16.0

Im using the UICollectionViewCompositionalLayout to lay my collection view items side by side for landscape and single tile on normal mood. Thus, I use NSCollectionLayoutGroups to achieve this ...
danu's user avatar
  • 1,098
0 votes
1 answer
41 views

All CollectionViewCell height equal to largest cell label dynamic content in swift

All CollectionViewCell height equal to largest cell label dynamic content full code in swif import UIKit class YourViewController: UIViewController, UICollectionViewDataSource, ...
dax tech's user avatar
0 votes
2 answers
140 views

How to display JSON image on CollectionViewCell using Swift

I am successfully fetching images from the API, but I don't know how to display it in the CollectionViewCell. Here is my code: import UIKit class MainCollectionViewCell: UICollectionViewCell { ...
Dilan's user avatar
  • 7
0 votes
1 answer
34 views

Fatal error: Index out of range . Coming near the comment

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell=colView1.dequeueReusableCell(withReuseIdentifier:"cell",...
Harsh Soni's user avatar
0 votes
1 answer
98 views

Access a visual element inside a collectionview in .net maui

I have this CollectionView. Inside are ellipses. I can't access them from code-behind. They are there, I can see them through the debugger. They are like (CollectionView.base.base.base.base.base.base....
Nevin Sever's user avatar
0 votes
0 answers
28 views

Focus skipping cells in custom CollectionViewLayout?

I am currently working on a tvOS app where I'm trying to display events in a time grid using a custom UICollectionViewLayout. I've hit a bit of a roadblock, and I'm hoping someone here can give me a ...
Tim's user avatar
  • 1
3 votes
1 answer
90 views

iOS App Freezing in UICollectionView code, but I don't have any UICollectionViews

One of my apps freezes whenever someone tries to edit a record (i.e. when I show the EditRecordViewController). I tried using Watchdog to detect a hanging main thread and cause a crash to get a ...
Kenny Wyland's user avatar
0 votes
0 answers
35 views

A string written twice on real iOS device, but correct on simulator

The string is 'Match Points:' on any real iOS device: on simulator iPhone 14 Pro: The chip is appeared when user selected and enabled search filter. There is the code on didSelectItemAt ...
Fathya's user avatar
  • 23
0 votes
0 answers
21 views

Voice Over is not reading back button on viewcontroller, but reads it if execute command in lldb

I have a UIViewController with a UICollectionView. In viewDidLoad, I fetch the data from a network request. I create the cells after receiving the response. Once the UI updates, I use UIAccessibility....
Paul Ancajima's user avatar
0 votes
0 answers
55 views

UICollectionViewCells are disappearing while scrolling

I am implementing a UICollectionView in in which there are 20 to 1000 counts. In this collectionview, i have a label and a view in cell. For every multiple of 5 the view of cell is bigger as compared ...
Abhishek kumar's user avatar
0 votes
0 answers
11 views

How to stop collection view receiving scroll events

Below is my view heirarchy. Here Overlay view is added as subview to collectionView with user interaction disabled. When tried to do scroll the collection view receives the events but they don't ...
kks's user avatar
  • 1
0 votes
1 answer
36 views

How to correctly scroll UICollectionView to a specific section header which has estimated supplementary view height?

My UICollectionView has multiple sections and has long list of items with supplementary header views. I need to animate to a specific section and show the section header in the view port. Tried to ...
Tushar's user avatar
  • 3,042
0 votes
1 answer
31 views

UICollectionView Cells not updating when associated data is updated

I have a collectionview, and each cell has an 'empty star' button. When the user taps on that button, the image of the button should become a 'filled star.' The collectionview should sort itself so ...
Moses Harding's user avatar
0 votes
1 answer
97 views

Multiple column layout with collection view compositional layout

I am converting some hairy collection view code (scroll views with embedded stack views, collection views, table views, etc.) to a single collection view with compositional layout. But I am having ...
Rob's user avatar
  • 420k
0 votes
0 answers
19 views

How to adjust cell height according to content?

i am making status app for ios and using my WordPress Website to fetch data. everything is working fine but the problem is content, I am using UIlabel to display status in cell. but the problem is ...
punjabidharti's user avatar
0 votes
1 answer
53 views

Why does my single-section, 2-group compositional layout only use the sizing of the first group in the section?

I am trying to create a compositional layout comprised of a group of 2 items, plus another group of 1 item. I would like each group to occupy the full screen width, and page-scroll between them. So ...
stackunderflow's user avatar
0 votes
1 answer
141 views

How to select only 1 item per section using diffable datasource

I have the following code final class ListViewController: UIViewController { let viewModel: ViewModel init(viewModel: ViewModel) { self.viewModel = viewModel super.init(...
Fernando Cruz's user avatar

1
2 3 4 5
287