ios - 列表中的标题(iOS 15)高于应有的高度
问题描述
我刚刚更新到 Xcode 13 和 iOS 15,我遇到了奇怪的故障,我无法弄清楚如何修复。我有一个List
带有标题。标题的固定高度为44.0
. iOS 14 上没有额外的空间。
截图:
列表:
var body: some View {
List {
pendingRequestsSection
visitedRequestsSection
}
.listStyle(InsetGroupedListStyle())
}
// Sections
private var pendingRequestsSection: some View {
Section(
content: {
if viewModel.pendingRowModels.isEmpty {
noRequestsRow
} else {
ForEach(viewModel.pendingRowModels, content: requestRow)
}
},
header: {
ListReloadView(
isLoading: $viewModel.isLoading,
lastFetchDate: $viewModel.recentFetchDate,
action: viewModel.reloadTapped
)
}
)
.textCase(nil)
}
...
标题:
var body: some View {
Button(
action: action,
label: { buttonContent }
)
.frame(height: 44.0)
}
// Helpers
private var buttonContent: some View {
HStack(alignment: .center) {
Spacer()
lastFetchDate.flatMap(timeLabel)
reloadLabel
Spacer()
}
}
private var reloadLabel: some View {
Text(isLoading ? "Loading..." : "Reload")
.font(.system(size: 12.0, weight: .semibold))
.foregroundColor(UIColor.accent.color)
.multilineTextAlignment(.center)
}
有任何想法吗?我对这个 iOS+Xcode 版本真的很生气。这么多的事情突然爆发了。嗯。提前致谢!
解决方案
推荐阅读
- python - Django按日历日期而不是发布日期订购事件
- c# - 在圆的边缘移动对象
- database - 无法更新 Mongoose 模型,.findByIdAndUpdate() 不起作用
- c++ - 如何在二维列表中插入元素,如向量?
- r - 在 r 的函数中将零项排除在“combn”中
- javascript - 如何将音频从浏览器实时流式传输到直播服务器
- python - 当我尝试加载数据时,来自 psycopg2.extras 的 execute_values 抛出“IndexError:list index out of range”
- kubernetes - 从外部世界访问 GKE 内的共享目录
- java - 如何使用 Java 地图
> - c# - 模型在数据网格中显示为列