Style server-rules-tableview (#690)
This commit is contained in:
parent
18a9cbe556
commit
63f11fd2a2
|
@ -49,7 +49,7 @@ extension ServerRulesTableViewCell {
|
||||||
|
|
||||||
private func _init() {
|
private func _init() {
|
||||||
selectionStyle = .none
|
selectionStyle = .none
|
||||||
backgroundColor = .clear
|
// backgroundColor = .systemBackground
|
||||||
|
|
||||||
indexImageView.translatesAutoresizingMaskIntoConstraints = false
|
indexImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
contentView.addSubview(indexImageView)
|
contentView.addSubview(indexImageView)
|
||||||
|
@ -71,15 +71,6 @@ extension ServerRulesTableViewCell {
|
||||||
contentView.bottomAnchor.constraint(greaterThanOrEqualTo: ruleLabel.bottomAnchor, constant: 11),
|
contentView.bottomAnchor.constraint(greaterThanOrEqualTo: ruleLabel.bottomAnchor, constant: 11),
|
||||||
ruleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
|
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),
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,11 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
|
||||||
var viewModel: MastodonServerRulesViewModel!
|
var viewModel: MastodonServerRulesViewModel!
|
||||||
|
|
||||||
let tableView: UITableView = {
|
let tableView: UITableView = {
|
||||||
let tableView = UITableView()
|
let tableView = UITableView(frame: .zero, style: .insetGrouped)
|
||||||
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
|
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
|
||||||
tableView.register(ServerRulesTableViewCell.self, forCellReuseIdentifier: String(describing: ServerRulesTableViewCell.self))
|
tableView.register(ServerRulesTableViewCell.self, forCellReuseIdentifier: String(describing: ServerRulesTableViewCell.self))
|
||||||
tableView.rowHeight = UITableView.automaticDimension
|
tableView.rowHeight = UITableView.automaticDimension
|
||||||
tableView.separatorStyle = .none
|
tableView.backgroundColor = .secondarySystemGroupedBackground
|
||||||
tableView.backgroundColor = .clear
|
|
||||||
tableView.keyboardDismissMode = .onDrag
|
tableView.keyboardDismissMode = .onDrag
|
||||||
tableView.sectionHeaderTopPadding = 0
|
tableView.sectionHeaderTopPadding = 0
|
||||||
return tableView
|
return tableView
|
||||||
|
|
Loading…
Reference in New Issue