Style server-rules-tableview (#690)

This commit is contained in:
Nathan Mattes 2022-12-15 22:24:43 +01:00
parent 18a9cbe556
commit 63f11fd2a2
2 changed files with 3 additions and 13 deletions

View File

@ -49,7 +49,7 @@ extension ServerRulesTableViewCell {
private func _init() {
selectionStyle = .none
backgroundColor = .clear
// backgroundColor = .systemBackground
indexImageView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(indexImageView)
@ -71,15 +71,6 @@ extension ServerRulesTableViewCell {
contentView.bottomAnchor.constraint(greaterThanOrEqualTo: ruleLabel.bottomAnchor, constant: 11),
ruleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
])
separatorLine.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(separatorLine)
NSLayoutConstraint.activate([
separatorLine.leadingAnchor.constraint(equalTo: ruleLabel.leadingAnchor),
separatorLine.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)).priority(.required - 1),
])
}
}

View File

@ -28,12 +28,11 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
var viewModel: MastodonServerRulesViewModel!
let tableView: UITableView = {
let tableView = UITableView()
let tableView = UITableView(frame: .zero, style: .insetGrouped)
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
tableView.register(ServerRulesTableViewCell.self, forCellReuseIdentifier: String(describing: ServerRulesTableViewCell.self))
tableView.rowHeight = UITableView.automaticDimension
tableView.separatorStyle = .none
tableView.backgroundColor = .clear
tableView.backgroundColor = .secondarySystemGroupedBackground
tableView.keyboardDismissMode = .onDrag
tableView.sectionHeaderTopPadding = 0
return tableView