Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS] Fix CollectionView crash in iOS 9 #14925

Merged
merged 1 commit into from
Nov 25, 2021
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
11 changes: 9 additions & 2 deletions Xamarin.Forms.Platform.iOS/CollectionView/ItemsViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,21 @@ void UpdateEmptyViewVisibility(bool isEmpty)
}
}

void AlignEmptyView()
void AlignEmptyView()
{
if (_emptyUIView == null)
{
return;
}

if (CollectionView.EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft)
bool isRtl;

if (Forms.IsiOS10OrNewer)
isRtl = CollectionView.EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft;
else
isRtl = CollectionView.SemanticContentAttribute == UISemanticContentAttribute.ForceRightToLeft;

if (isRtl)
{
if (_emptyUIView.Transform.xx == -1)
{
Expand Down