小编Max*_*xim的帖子

SwiftUI:Spacer 在 ScrollView 上不起作用

如何在 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)
    }
Run Code Online (Sandbox Code Playgroud)

我拥有的

我想要什么

scrollview ios swift swiftui vstack

22
推荐指数
2
解决办法
8330
查看次数

标签 统计

ios ×1

scrollview ×1

swift ×1

swiftui ×1

vstack ×1