fix: poll option view using wrong dark mode background color issue

This commit is contained in:
CMK 2021-05-06 16:43:54 +08:00
parent 5d6004c3dc
commit d23eaf3dd7
2 changed files with 11 additions and 4 deletions

View File

@ -82,7 +82,7 @@ final class PollOptionView: UIView {
extension PollOptionView { extension PollOptionView {
private func _init() { private func _init() {
// default color in the timeline // default color in the timeline
roundedBackgroundView.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color roundedBackgroundView.backgroundColor = Asset.Colors.Background.secondarySystemBackground.color
roundedBackgroundView.translatesAutoresizingMaskIntoConstraints = false roundedBackgroundView.translatesAutoresizingMaskIntoConstraints = false
addSubview(roundedBackgroundView) addSubview(roundedBackgroundView)
@ -193,6 +193,11 @@ struct PollOptionView_Previews: PreviewProvider {
PollOptionView() PollOptionView()
} }
.previewLayout(.fixed(width: 375, height: 100)) .previewLayout(.fixed(width: 375, height: 100))
UIViewPreview(width: 375) {
PollOptionView()
}
.preferredColorScheme(.dark)
.previewLayout(.fixed(width: 375, height: 100))
} }
} }

View File

@ -129,14 +129,16 @@ struct PollTableViewCell_Previews: PreviewProvider {
} }
.previewLayout(.fixed(width: 375, height: 44 + 10)) .previewLayout(.fixed(width: 375, height: 44 + 10))
} }
.background(Color(.systemBackground))
} }
static var previews: some View { static var previews: some View {
Group { Group {
controls.colorScheme(.light) controls
controls.colorScheme(.dark) .colorScheme(.light)
controls
.colorScheme(.dark)
} }
.background(Color.gray)
} }
} }