fix: app enter background break profile header layout issue

This commit is contained in:
CMK 2022-05-13 17:26:57 +08:00
parent 3bdd9dc4aa
commit 8efaf38395
1 changed files with 8 additions and 2 deletions

View File

@ -408,7 +408,13 @@ extension ProfileHeaderView {
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection) super.traitCollectionDidChange(previousTraitCollection)
// workaround enter background breaking the layout issue
switch UIApplication.shared.applicationState {
case .active:
updateLayoutMargins() updateLayoutMargins()
default:
break
}
} }
} }