Change header aspect ratio

This commit is contained in:
Justin Mazzocchi 2020-09-27 22:22:01 -07:00
parent 6d3c66d251
commit 7ce055ac1d
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 3 additions and 1 deletions

View File

@ -68,6 +68,8 @@ private extension AccountHeaderView {
addSubview(headerImageView) addSubview(headerImageView)
addSubview(baseStackView) addSubview(baseStackView)
headerImageView.translatesAutoresizingMaskIntoConstraints = false headerImageView.translatesAutoresizingMaskIntoConstraints = false
headerImageView.contentMode = .scaleAspectFill
headerImageView.clipsToBounds = true
baseStackView.translatesAutoresizingMaskIntoConstraints = false baseStackView.translatesAutoresizingMaskIntoConstraints = false
baseStackView.axis = .vertical baseStackView.axis = .vertical
@ -91,7 +93,7 @@ private extension AccountHeaderView {
let headerImageAspectRatioConstraint = headerImageView.heightAnchor.constraint( let headerImageAspectRatioConstraint = headerImageView.heightAnchor.constraint(
equalTo: headerImageView.widthAnchor, equalTo: headerImageView.widthAnchor,
multiplier: 9 / 16) multiplier: 1 / 3)
headerImageAspectRatioConstraint.priority = .init(999) headerImageAspectRatioConstraint.priority = .init(999)