Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,10 @@ public override UICollectionViewLayoutAttributes PreferredLayoutAttributesFittin

if (_measureInvalidated || constraintsChanged)
{
// Dynamic content invalidations need an inline arrange so the
// updated content is rendered immediately. Constraint changes,
// such as rotation, are deferred to LayoutSubviews when the
// cell has already been arranged so the final native bounds
// are used for the arrange.
shouldArrangeInline =
!constraintsChanged && !_invalidatedDuringArrange;

// External invalidations need a synchronous arrange even if the outer
// size is unchanged. Arrange-induced invalidations only need another
// inline arrange when measurement produces a different size.
shouldArrangeInline = !_invalidatedDuringArrange || constraintsChanged;
_invalidatedDuringArrange = false;

// Preserve invalidations raised by Measure or Arrange for the next pass.
Expand Down Expand Up @@ -184,8 +180,9 @@ public override UICollectionViewLayoutAttributes PreferredLayoutAttributesFittin
preferredAttributes.ZIndex = 2;

if (_needsArrange &&
((shouldArrangeInline && _hasArrangedSize) ||
!_hasArrangedSize))
(shouldArrangeInline ||
!_hasArrangedSize ||
!size.ToCGSize().IsCloseTo(_lastArrangedSize)))
{
ArrangeVirtualView(virtualView, size);
}
Expand Down Expand Up @@ -267,8 +264,7 @@ public override void LayoutSubviews()
double.IsPositiveInfinity(_cachedConstraints.Height) ? boundsSize.Height : _cachedConstraints.Height));

if (safeAreaChanged ||
needsFinalArrange ||
(boundsChanged && measuredConstraintsMatchBounds))
(boundsChanged && (needsFinalArrange || measuredConstraintsMatchBounds)))
{
ArrangeVirtualView(virtualView, boundsSize);
}
Expand Down
Loading