Поэтому мне нужно переместить этот прямоугольник в нижнюю часть строки.
Упрощенный код:
Код: Выделить всё
GeometryReader { geo in
ZStack {
// Gradient Background
AnimatedGradBackground(type: .blackWhite)
ScrollView {
LazyVStack {
HStack(alignment: .bottom) {
// MARK: Main Line
(ZStack with some code)
Spacer()
// MARK: Text and Goal Button
VStack {
// Goal Button
if showMainButton {
Circle()
.opacity(0)
.overlay {
GoalButtonView(completedLongPress: $completedLongPress)
}
.scaleEffect(0.9)
.transition(
.asymmetric(
insertion: .move(edge: .top).combined(with: .opacity),
removal: .scale
))
}
// Text
if showTransitionText {
VStack(alignment: .center) {
Text("The Hardest Part")
.font(.title3.bold())
Text("This is actually the most important step you can take")
}
.foregroundStyle(.white)
.frame(width: geo.size.width / 1.8)
.transition(
.asymmetric(
insertion: .move(edge: .top).combined(with: .opacity),
removal: .move(edge: .bottom).combined(with: .opacity)
))
}
Rectangle() // rect to see the frame
}
.animation(.easeInOut.speed(0.3), value: isLinePressed)
}
}
.frame(minHeight: geo.size.height * Double(checkPointsNum / 2)) // I tried default frame and this frame still the same result
}
.defaultScrollAnchor(.bottom)
}
}
.ignoresSafeArea()

Подробнее здесь: https://stackoverflow.com/questions/785 ... in-swiftui