SwiftUI Swift 问答之SwiftUI设置节标题高度?
设置 swift SwiftUI 高度 标题 问答
2023-09-11 14:18:30 时间
实战问题
我有一个清单:
List {
ForEach(model.sections) { s in
Section(header: SectionView()) {
ForEach(items, id: \.self) { item in
Text(item.name)
.border(Color.mint)
}
}
}
}
.listStyle(.plain)
我有SectionView我想为节标题构建的视图:
struct SectionView: View {
var body: some View {
GeometryReader { geo in
HStack {
Text("Section Header View")
.frame(width: geo.size.width, height: 60)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.border(Color.green)
}
}
}
不幸的SectionView是,标题中的内容现在在单元格上流血了。实际的节标题高度没有改变。如何设置自定义节标题高度&
相关文章
- 教程-Delphi设置功能表
- swift关于UIView设置frame值的extension
- loadrunner 立即执行+定时执行设置
- 登陆iSQLPlus的设置方法(转)
- SAP Spartacus Theme 设置
- 如何在Chrome开发者工具console里手动调用focus方法给元素设置focus
- ios swift 纯代码设置UITableViewCell的style
- iOS swift 设置UIButton字体大小
- iOS swift 设置电量 计算属性实例
- [快速学会Swift第三方库] SQLite.swift篇
- Android 11.0 设置默认DNS
- java poi - excel cell 设置自定义颜色
- 【CSS】盒子模型内边距 ① ( 内边距概念 | 内边距设置语法 | 内边距设置效果 | 代码示例 )
- iptables之centos6版本常用设置
- 【Spring注解驱动开发】使用@Scope注解设置组件的作用域
- Java各种日期格式的获取和设置指定日期
- Swift开发教程--怎样设置状态栏的文字颜色
- Win11怎么设置自动清空回收站操作教学
- cocos2d-x for wp8 设置横竖屏
- VC++ socket编程中设置socket选项的ioctlsocket、setsockopt和WSAIoctl函数的使用(附源码)
- Android设置系统属性值(ro.xx等)
- Win10 如何设置自动锁定屏幕