forked from zelo72/mastodon-ios
fix: compose tabBar button layout raise crash on iPad issue
This commit is contained in:
parent
ca0a697cd0
commit
bbb46e62fd
|
@ -406,8 +406,10 @@ extension MainTabBarController {
|
||||||
switch traitCollection.horizontalSizeClass {
|
switch traitCollection.horizontalSizeClass {
|
||||||
case .compact:
|
case .compact:
|
||||||
tabBar.isHidden = false
|
tabBar.isHidden = false
|
||||||
|
composeButttonShadowBackgroundContainer.isHidden = false
|
||||||
default:
|
default:
|
||||||
tabBar.isHidden = true
|
tabBar.isHidden = true
|
||||||
|
composeButttonShadowBackgroundContainer.isHidden = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +430,7 @@ extension MainTabBarController {
|
||||||
anchorImageView.alpha = 0
|
anchorImageView.alpha = 0
|
||||||
|
|
||||||
composeButttonShadowBackgroundContainer.translatesAutoresizingMaskIntoConstraints = false
|
composeButttonShadowBackgroundContainer.translatesAutoresizingMaskIntoConstraints = false
|
||||||
tabBar.addSubview(composeButttonShadowBackgroundContainer)
|
self.view.addSubview(composeButttonShadowBackgroundContainer) // add to tabBar will crash on iPad when size class changing
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
composeButttonShadowBackgroundContainer.centerXAnchor.constraint(equalTo: anchorImageView.centerXAnchor),
|
composeButttonShadowBackgroundContainer.centerXAnchor.constraint(equalTo: anchorImageView.centerXAnchor),
|
||||||
composeButttonShadowBackgroundContainer.centerYAnchor.constraint(equalTo: anchorImageView.centerYAnchor),
|
composeButttonShadowBackgroundContainer.centerYAnchor.constraint(equalTo: anchorImageView.centerYAnchor),
|
||||||
|
|
Loading…
Reference in New Issue