This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Xamarin.Forms.Platform.iOS Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ public void PrepareCellForLayout(ItemsViewCell cell)
170
170
171
171
public override bool ShouldInvalidateLayout ( UICollectionViewLayoutAttributes preferredAttributes , UICollectionViewLayoutAttributes originalAttributes )
172
172
{
173
+ // This is currently causing an infinite layout loop on iOS 15 https://github.com/xamarin/Xamarin.Forms/issues/15230
174
+ if ( preferredAttributes . RepresentedElementKind == "UICollectionElementKindSectionHeader" && Forms . IsiOS154OrNewer )
175
+ return base . ShouldInvalidateLayout ( preferredAttributes , originalAttributes ) ;
176
+
173
177
if ( ItemSizingStrategy == ItemSizingStrategy . MeasureAllItems )
174
178
{
175
179
if ( preferredAttributes . Bounds != originalAttributes . Bounds )
Original file line number Diff line number Diff line change 1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Diagnostics ;
4
4
using System . IO ;
@@ -41,6 +41,7 @@ public static class Forms
41
41
static bool ? s_isiOS13OrNewer ;
42
42
static bool ? s_isiOS14OrNewer ;
43
43
static bool ? s_isiOS15OrNewer ;
44
+ static bool ? s_isiOS154OrNewer ;
44
45
static bool ? s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden ;
45
46
46
47
internal static bool IsiOS9OrNewer
@@ -114,6 +115,16 @@ internal static bool IsiOS15OrNewer
114
115
}
115
116
}
116
117
118
+ internal static bool IsiOS154OrNewer
119
+ {
120
+ get
121
+ {
122
+ if ( ! s_isiOS154OrNewer . HasValue )
123
+ s_isiOS154OrNewer = UIDevice . CurrentDevice . CheckSystemVersion ( 15 , 4 ) ;
124
+ return s_isiOS154OrNewer . Value ;
125
+ }
126
+ }
127
+
117
128
118
129
internal static bool RespondsToSetNeedsUpdateOfHomeIndicatorAutoHidden
119
130
{
You can’t perform that action at this time.
0 commit comments