Questions tagged [nscollectionviewlayout]

10 questions
3
votes
1 answer

NSCollectionView interitem gap indicator has wrong height

I'm implementing an application for macOS in which I use an NSCollectionView as a sort of timeline. For this I use a custom subclass of NSCollectionViewFlowLayout for the following reasons: I want the items to be scrollable horizontally only…
2
votes
0 answers

How to interactively rearrange NSCollectionView items while dragging over them?

Apps like Preview indicate the drop position for drag operations by interactively moving the items out of the way. Looks like this: IIRC, this is also the default behaviour of UICollectionView with all standard layouts. In contrast,…
2
votes
1 answer

Using mixed fractional and absolute values to size a NSCollectionLayoutItem

I am sizing a NSCollectionLayoutItem in its group. Using NSCollectionLayoutSize and NSCollectionLayoutDimension I can achieve requirements such as ‘I want it to be half the width of its container’ or ' I want it to be 200px’ or ’I want its height to…
user236739
  • 1,323
  • 2
  • 15
  • 21
2
votes
1 answer

How to animate a relayout of NSCollectionViewLayout on bounds change?

I have a basic implementation of NSCollectionViewLayout very similar to NSCollectionViewFlowLayout: It places item in a horizontal row. If there's not enough room, the next item is added to the next row and so on. My question: how can I animate a…
1
vote
0 answers

NSCollectionView as NSCollectionViewItem

Here is the window I want to achieve: It is a NSViewController (RedViewController) with NSCollectionView (RedCollectionView) as view. It item (BlueItem) has a NSCollectionView (BlueCollectionView) as view. It item's item (GreenItem), has a…
1
vote
1 answer

invalidationContext(forPreferredLayoutAttributes:withOriginalAttributes:) isn't called on a custom NSCollectionViewLayout subclass

Link to the relevant sample project Description I’m trying to create a custom NSCollectionViewLayout subclass that uses use Auto Layout to determine its items’ sizes. This layout positions items from top-to-bottom, where all items share the same…
1
vote
0 answers

Constraint preferredLayoutAttributes width

I work on a custom subclass of UICollectionViewLayout with fixed columns and vertically growing items similar to Trello. Each item is basically a view that contains a few vertically stacked labels. Currently what I observe is that…
pronebird
  • 12,068
  • 5
  • 54
  • 82
0
votes
1 answer

NSCollectionViewAttributes not getting applied correctly with custom NSFlowLayout subclass

I'm currently working on an NSCollectionView with a custom layout. For that purpose, I subclassed NSCollectionViewFlowLayout to top-align my items (which all have a fixed width what made the algorithm pretty easy). The problem I have now is that…
0
votes
0 answers

Custom NSCollectionViewLayout is not displaying anything

I'm trying to learn how to create a custom NSCollectionViewLayout. I've followed some tutorials, but I always got the same result, an empty CollectionView. The code that I've been using is this one:…
Jacobo
  • 1,259
  • 2
  • 19
  • 43
0
votes
1 answer

Swift NSCollectionView flow from bottom to top

I am workin on a messaging client for macOS, written in Swift. I use an NSScrollView with an NSCollectionView as the documentView to present the messages. Currently, I have implemented infinite scrolling, but now the problem is that the…