File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Xamarin.Forms.Platform.iOS Expand file tree Collapse file tree 2 files changed +27
-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 ;
@@ -40,6 +40,8 @@ public static class Forms
40
40
static bool ? s_isiOS12OrNewer ;
41
41
static bool ? s_isiOS13OrNewer ;
42
42
static bool ? s_isiOS14OrNewer ;
43
+ static bool ? s_isiOS15OrNewer ;
44
+ static bool ? s_isiOS154OrNewer ;
43
45
static bool ? s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden ;
44
46
45
47
internal static bool IsiOS9OrNewer
@@ -103,6 +105,26 @@ internal static bool IsiOS14OrNewer
103
105
}
104
106
}
105
107
108
+ internal static bool IsiOS15OrNewer
109
+ {
110
+ get
111
+ {
112
+ if ( ! s_isiOS15OrNewer . HasValue )
113
+ s_isiOS15OrNewer = UIDevice . CurrentDevice . CheckSystemVersion ( 15 , 0 ) ;
114
+ return s_isiOS15OrNewer . Value ;
115
+ }
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
+
106
128
107
129
internal static bool RespondsToSetNeedsUpdateOfHomeIndicatorAutoHidden
108
130
{
You can’t perform that action at this time.
0 commit comments