The estimated size of items in the collection view.
SDK
- macOS 10.11+
Framework
- App
Kit
Declaration
@property NSSize estimatedItemSize;
Discussion
Providing an estimated item size lets the collection view defer some of the calculations needed to determine the size of its content, which can improve performance. Instead of explicitly computing the size of each item, the flow layout assumes that offscreen items have the estimated size. The estimated size is used only until an actual value is calculated. The default value of this property is NSZero
.
If the value of this property is not NSZero
, the flow layout uses the estimated size you specified. If all of your items actually have the same size, use the item
property to set their size and set this property to NSZero
. For more information about how item sizes are determined, see Understanding How the Flow Layout is Generated.