iOS 14 has Changed (or broken?) SwiftUI GeometryReader

前端 未结 2 1065
醉梦人生
醉梦人生 2021-01-02 11:25

As of today\'s release of iOS 14.0 my iOS code, which depends heavily on GeometryReader for layout, is no longer working well. I.e, layout has been kind of randomized.

2条回答
  •  心在旅途
    2021-01-02 11:46

    It's definitely changed - this post sums it up: https://swiftui-lab.com/geometryreader-bug/

    GeometryReader now lays out its content different to how it used to. It used to centre it horizontally and vertically in the parent but now it aligns it to the top-left.

    My app looks awful - what's frustrating is it's not clear if this is new behaviour and is as-designed, or whether it's a bug and will be fixed. I'm trying to go through my app and manually apply offsets but the dynamic nature of layouts using GeometryReader means it is not always easy.

提交回复
热议问题