forked from zelo72/mastodon-ios
fix: player content overlay layout issue. resolve #132
This commit is contained in:
parent
eb86247419
commit
93c9289b1f
Mastodon/Scene/Share/View/Container
|
@ -75,16 +75,6 @@ extension PlayerContainerView {
|
||||||
mediaTypeIndicotorView.widthAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.width).priority(.required - 1),
|
mediaTypeIndicotorView.widthAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.width).priority(.required - 1),
|
||||||
])
|
])
|
||||||
|
|
||||||
contentWarningOverlayView.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
addSubview(contentWarningOverlayView)
|
|
||||||
NSLayoutConstraint.activate([
|
|
||||||
contentWarningOverlayView.topAnchor.constraint(equalTo: topAnchor),
|
|
||||||
contentWarningOverlayView.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
||||||
contentWarningOverlayView.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
||||||
contentWarningOverlayView.bottomAnchor.constraint(equalTo: bottomAnchor)
|
|
||||||
])
|
|
||||||
contentWarningOverlayView.delegate = self
|
|
||||||
|
|
||||||
mediaTypeIndicotorViewInContentWarningOverlay.translatesAutoresizingMaskIntoConstraints = false
|
mediaTypeIndicotorViewInContentWarningOverlay.translatesAutoresizingMaskIntoConstraints = false
|
||||||
contentWarningOverlayView.addSubview(mediaTypeIndicotorViewInContentWarningOverlay)
|
contentWarningOverlayView.addSubview(mediaTypeIndicotorViewInContentWarningOverlay)
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
|
@ -93,6 +83,8 @@ extension PlayerContainerView {
|
||||||
mediaTypeIndicotorViewInContentWarningOverlay.heightAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.height).priority(.required - 1),
|
mediaTypeIndicotorViewInContentWarningOverlay.heightAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.height).priority(.required - 1),
|
||||||
mediaTypeIndicotorViewInContentWarningOverlay.widthAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.width).priority(.required - 1),
|
mediaTypeIndicotorViewInContentWarningOverlay.widthAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.width).priority(.required - 1),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
contentWarningOverlayView.delegate = self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +139,16 @@ extension PlayerContainerView {
|
||||||
containerHeightLayoutConstraint.constant = floor(rect.height)
|
containerHeightLayoutConstraint.constant = floor(rect.height)
|
||||||
containerHeightLayoutConstraint.isActive = true
|
containerHeightLayoutConstraint.isActive = true
|
||||||
|
|
||||||
|
contentWarningOverlayView.removeFromSuperview()
|
||||||
|
contentWarningOverlayView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
addSubview(contentWarningOverlayView)
|
||||||
|
NSLayoutConstraint.activate([
|
||||||
|
contentWarningOverlayView.topAnchor.constraint(equalTo: touchBlockingView.topAnchor),
|
||||||
|
contentWarningOverlayView.leadingAnchor.constraint(equalTo: touchBlockingView.leadingAnchor),
|
||||||
|
contentWarningOverlayView.trailingAnchor.constraint(equalTo: touchBlockingView.trailingAnchor),
|
||||||
|
contentWarningOverlayView.bottomAnchor.constraint(equalTo: touchBlockingView.bottomAnchor)
|
||||||
|
])
|
||||||
|
|
||||||
bringSubviewToFront(mediaTypeIndicotorView)
|
bringSubviewToFront(mediaTypeIndicotorView)
|
||||||
|
|
||||||
return playerViewController
|
return playerViewController
|
||||||
|
|
Loading…
Reference in New Issue