hstack-snap-to-scroll icon indicating copy to clipboard operation
hstack-snap-to-scroll copied to clipboard

It is not working on orientation change.

Open MrEldin opened this issue 3 years ago • 2 comments
trafficstars

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)

MrEldin avatar Apr 05 '22 03:04 MrEldin

Did you find a solution?

aehlke avatar Jun 29 '22 01:06 aehlke

@aehlke MrEldin Do you get the same behaviour on iPad? I can get it to work on iPhone portrait but not landscape or iPad. When in landscape or iPad, the neighbouring items display off screen.

codeandclay avatar Jun 29 '22 19:06 codeandclay