swiftui - 使用 SwiftUI 等高子视图
问题描述
等于 Image(方形)和 TextOne 的高度,带有填充。没有 GeometryReader 怎么办?
我不能使用 GeometryReader 因为我将此视图用作列表行
var body: some View {
return HStack {
VStack {
Image(systemName: "name").resizable().frame(width: ???, height: ???)
Spacer()
}
VStack {
HStack (alignment: .center) {
Text("TextOne").padding()
Spacer()
Text("TextTwo").padding()
}
HStack (alignment: .top) {
Text("TextDownOne").padding()
Spacer()
Button(action: { action() }) {
Text("ButtonText").padding()
}
}
}
}
}
解决方案
推荐阅读
- firebase - get() 和 getAfter() 之间的 Firebase 安全规则差异
- python - tkinter 画布未绘制顶部和左侧线
- javascript - 如何将弹出式浏览器窗口置于最前面,使其位于所有浏览器窗口之上?
- amazon-web-services - 如何修复“使用这些代码失败的健康检查:”在 elasticbeanstalk 实例上?
- python - For 循环覆盖先前的结果
- c - 通过 fgets 从 txt 文件中检索到的部分文本在 c 中丢失了
- ios - 检测更改文本的键盘组合
- kotlin - 使用 remoteMessage.notification.body 的实际有效负载时,smallIcon 是圆形灰色斑点
- javascript - Javascript将blob添加到html输入值
- python - Django:如何检查呈现模板的视图