fix: profile segmented controls missing margin issue

This commit is contained in:
CMK 2022-02-10 15:53:38 +08:00
parent ba76fc51a1
commit 05646e6f59
2 changed files with 4 additions and 4 deletions

View File

@ -282,7 +282,7 @@ extension ProfileHeaderView {
avatarImageViewBackgroundView.translatesAutoresizingMaskIntoConstraints = false avatarImageViewBackgroundView.translatesAutoresizingMaskIntoConstraints = false
addSubview(avatarImageViewBackgroundView) addSubview(avatarImageViewBackgroundView)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
avatarImageViewBackgroundView.leadingAnchor.constraint(equalTo: bannerContainerView.readableContentGuide.leadingAnchor), avatarImageViewBackgroundView.leadingAnchor.constraint(equalToSystemSpacingAfter: bannerContainerView.leadingAnchor, multiplier: 2.0),
// align to dashboardContainer bottom // align to dashboardContainer bottom
]) ])
@ -338,8 +338,8 @@ extension ProfileHeaderView {
addSubview(container) addSubview(container)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
container.topAnchor.constraint(equalTo: bannerContainerView.bottomAnchor), container.topAnchor.constraint(equalTo: bannerContainerView.bottomAnchor),
container.leadingAnchor.constraint(equalTo: leadingAnchor), container.leadingAnchor.constraint(equalToSystemSpacingAfter: leadingAnchor, multiplier: 2.0),
container.trailingAnchor.constraint(equalTo: trailingAnchor), trailingAnchor.constraint(equalToSystemSpacingAfter: container.trailingAnchor, multiplier: 2.0),
container.bottomAnchor.constraint(equalTo: bottomAnchor), container.bottomAnchor.constraint(equalTo: bottomAnchor),
]) ])

View File

@ -279,7 +279,7 @@ extension ProfileViewController {
self.profileHeaderViewController.view.addSubview(buttonBar) self.profileHeaderViewController.view.addSubview(buttonBar)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
buttonBar.topAnchor.constraint(equalTo: self.profileHeaderViewController.profileHeaderView.bottomAnchor), buttonBar.topAnchor.constraint(equalTo: self.profileHeaderViewController.profileHeaderView.bottomAnchor),
buttonBar.leadingAnchor.constraint(equalTo: self.profileHeaderViewController.view.layoutMarginsGuide.leadingAnchor), buttonBar.leadingAnchor.constraint(equalToSystemSpacingAfter: self.profileHeaderViewController.view.leadingAnchor, multiplier: 2.0),
buttonBar.trailingAnchor.constraint(equalTo: self.profileHeaderViewController.view.layoutMarginsGuide.trailingAnchor), buttonBar.trailingAnchor.constraint(equalTo: self.profileHeaderViewController.view.layoutMarginsGuide.trailingAnchor),
buttonBar.bottomAnchor.constraint(equalTo: self.profileHeaderViewController.view.bottomAnchor), buttonBar.bottomAnchor.constraint(equalTo: self.profileHeaderViewController.view.bottomAnchor),
buttonBar.heightAnchor.constraint(equalToConstant: ProfileHeaderViewController.segmentedControlHeight).priority(.required - 1), buttonBar.heightAnchor.constraint(equalToConstant: ProfileHeaderViewController.segmentedControlHeight).priority(.required - 1),