feat: setting样式

This commit is contained in:
jinyaqiu 2025-08-15 16:05:50 +08:00
parent 35962c644e
commit 095d95b420
2 changed files with 21 additions and 20 deletions

View File

@ -35,16 +35,13 @@ struct SettingsView: View {
Image(systemName: "chevron.left")
.font(.system(size: 16, weight: .medium))
.foregroundColor(.blue)
Text("返回")
.font(.system(size: 17, weight: .regular))
.foregroundColor(.blue)
}
}
Spacer()
//
Text("设置")
Text("Setting")
.font(.headline)
Spacer()
@ -53,51 +50,52 @@ struct SettingsView: View {
Color.clear
.frame(width: 44, height: 44)
}
.padding(.horizontal)
.padding(.horizontal,16)
.padding(.vertical, 8)
.background(Color(.systemBackground))
//
List {
// Section
Section { EmptyView() }
//
settingRow(
icon: "person.crop.circle",
title: "账号与安全",
title: "Account & Security",
action: {}
)
//
settingRow(
icon: "lock.shield",
title: "权限管理",
title: "Permission Management",
action: {}
)
//
settingRow(
icon: "questionmark.circle",
title: "支持与服务",
title: "Support & Service",
action: {}
)
//
settingRow(
icon: "info.circle",
title: "关于我们",
title: "About Us",
action: {}
)
}
.listStyle(GroupedListStyle())
//
.listStyle(PlainListStyle())
// 线
.listRowSeparator(.hidden)
//
.listRowInsets(EdgeInsets())
.background(Color(.systemGroupedBackground))
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(.systemBackground))
.background(Color(.systemGroupedBackground))
// regular
.environment(\.horizontalSizeClass, .regular)
.environment(\.defaultMinListRowHeight, 50)
.onAppear(perform: configureTableView)
}
// MARK: -
@ -106,6 +104,8 @@ struct SettingsView: View {
private func configureTableView() {
// 线
UITableView.appearance().tableFooterView = UIView()
// 线
UITableView.appearance().tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: CGFloat.leastNonzeroMagnitude))
// 线
UITableView.appearance().separatorInset = .zero
//
@ -138,12 +138,13 @@ struct SettingsView: View {
.font(.system(size: 14))
.foregroundColor(.gray)
}
.padding(.vertical, 12)
.padding(.horizontal, 16)
.background(Color(.systemBackground))
.padding(.vertical, 6) //
.padding(.horizontal, 12)
.background(Color(.systemGroupedBackground))
}
.buttonStyle(PlainButtonStyle())
.listRowBackground(Color(.systemBackground))
.listRowBackground(Color(.systemGroupedBackground))
.listRowSeparator(.hidden)
}
}