Hi there,
We have a spot in our app where we use a GeometryReader to create a circle as a background view on a Text view. It seems as though GeometryReader's behavior has changed between iOS 13 and iOS 14. On iOS 13, the background circle is centered by default; on iOS 14 it is not.
My question is: how exactly has GeometryReader's behavior changed between iOS 13 and iOS 14, and can the docs be updated to reflect these changes?
Here's the sample code to reproduce:
On iOS 14, adding the following viewmodifer to the Circle adjusts the behavior to be the same as iOS 13
We have a spot in our app where we use a GeometryReader to create a circle as a background view on a Text view. It seems as though GeometryReader's behavior has changed between iOS 13 and iOS 14. On iOS 13, the background circle is centered by default; on iOS 14 it is not.
My question is: how exactly has GeometryReader's behavior changed between iOS 13 and iOS 14, and can the docs be updated to reflect these changes?
Here's the sample code to reproduce:
Code Block Swift struct ContentView: View { var body: some View { Text("Test") .foregroundColor(Color.white) .background( GeometryReader { geometry in Circle() .frame(width: max(geometry.size.width, geometry.size.height) + 10, height: max(geometry.size.width, geometry.size.height) + 10) .foregroundColor(.red) } ) } }
On iOS 14, adding the following viewmodifer to the Circle adjusts the behavior to be the same as iOS 13
Code Block Swift .position(x: geometry.size.width / 2, y: geometry.size.height / 2)