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