Программируем под IOS
Anonymous
SwiftUI: Spacer не работает в ScrollView
Сообщение
Anonymous » 23 окт 2025, 13:54
Как мне получить место в VStack для закрепления кнопки внизу?
Код: Выделить всё
ScrollView {
VStack() {
Text("Title_1")
.padding(.bottom, 35.0)
Text("Title_2")
.padding(.bottom, 32.0)
Text("Title_3")
.padding(.bottom, 27.0)
Spacer()
Button(action: { print("ACTION") }) {
Text("OK")
.font(.title)
.fontWeight(.semibold)
.foregroundColor(Color.red)
}
.frame(height: 35)
.cornerRadius(8.0)
.padding(.bottom, 25.0)
}
.frame(maxWidth: .infinity)
}
что у меня есть
что я хочу иметь
Подробнее здесь:
https://stackoverflow.com/questions/681 ... scrollview
1761216884
Anonymous
Как мне получить место в VStack для закрепления кнопки внизу? [code]ScrollView { VStack() { Text("Title_1") .padding(.bottom, 35.0) Text("Title_2") .padding(.bottom, 32.0) Text("Title_3") .padding(.bottom, 27.0) Spacer() Button(action: { print("ACTION") }) { Text("OK") .font(.title) .fontWeight(.semibold) .foregroundColor(Color.red) } .frame(height: 35) .cornerRadius(8.0) .padding(.bottom, 25.0) } .frame(maxWidth: .infinity) } [/code] что у меня есть что я хочу иметь Подробнее здесь: [url]https://stackoverflow.com/questions/68150889/swiftui-spacer-doesnt-work-at-scrollview[/url]