Skip to content

It is not working on orientation change. #8

Open
@MrEldin

Description

@MrEldin

If you change orientation to landscape, HStackSnap not working as expected. I think there is a problem because the width of the stack is changed. Is there any solution for this?

HStackSnap(alignment: .leading(20)) {
  ForEachWithIndex(elements: self.dayStore.days) { index, day in
      GeometryReader { cardGeo in
          VStack {
              Text("cao \(index)")
          }
          .frame(maxWidth: .infinity)
          .frame(maxHeight: .infinity)
          .background(RoundedCorners(color: Color("Neutral White"), tl: 20, tr: 20, bl: 20, br: 20))
          .rotation3DEffect(Angle(degrees: (Double(cardGeo.frame(in: .global).minX))) / -30, axis: (x: 0, y: 10.0, z: 0))
          .snapAlignmentHelper(id: day.id)
      }
      .frame(width: abs(geo.size.width - 80))
      .frame(maxHeight: .infinity)
  }
}
.padding(.top, 10)
.padding(.bottom, 10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions