swiftui - hstack 中的组可以让 vstack spacer() 出错,任何人都可以告诉我为什么
问题描述
我的代码:
ScrollView(.horizontal, showsIndicators: false){
VStack{
HStack{
VStack(alignment:.leading){
Text("monday,aug 2010".uppercased())
.font(.caption)
Text("your reading".capitalized)
.font(.title)
.fontWeight(.bold)
}
.padding([.top, .leading, .trailing])
Spacer()
}
HStack(alignment:.center){
Group{
CardView(image: "swiftui-button", category: "SwiftUI", heading: "Drawing a Border with Rounded Corners", author: "Simon Ng")
CardView(image: "macos-programming", category: "macOS", heading: "Building a Simple Editing APP", author: "Gabriel Theodoropoulos")
CardView(image: "flutter-app", category: "Flutter", heading: "Building a complex app with flutter", author: "Lawrence Tan")
CardView(image: "natural-language-api", category: "ios", heading: "What's New in Natural Language API", author: "Sai kambampati")
}.frame(width:300)
}
Spacer()
}
}
myQuestion:VStack(alignment:.leading) 位于中心,而不是前导,如果我删除 group{},它可以工作,但是如果我将 group 添加到 hstack,是错误的,我认为这是一个有趣的错误,你能想到出来?
解决方案
推荐阅读
- java - 一些测试没有被执行,但如果单独运行则执行得很好
- angular - 导出类的公共属性 X 具有或正在使用来自外部模块“/rxjs/internal/Observable”的名称“Observable”,但无法命名
- telnet - 无法启动 Gogo shell 连接失败错误
- php - 当其中一个表中没有记录时,不显示记录
- python-3.x - 无法从 tkinter 字段将字符串转换为浮点数
- spring - Mongo Flux/Mono 验证后添加元素
- python - Python -> 复制目录,而另一个进程从中删除/添加文件
- python-3.x - 如何在同步测试类中使用 pyfakefs 测试 aiofile
- mysql - MySQL RDS 错误日志导入自定义警报
- spring-boot - 为什么spring boot应用程序无法启动缺少错误