fix: player content overlay layout issue. resolve #132
This commit is contained in:
parent
eb86247419
commit
93c9289b1f
|
@ -75,16 +75,6 @@ extension PlayerContainerView {
|
|||
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
|
||||
contentWarningOverlayView.addSubview(mediaTypeIndicotorViewInContentWarningOverlay)
|
||||
NSLayoutConstraint.activate([
|
||||
|
@ -93,6 +83,8 @@ extension PlayerContainerView {
|
|||
mediaTypeIndicotorViewInContentWarningOverlay.heightAnchor.constraint(equalToConstant: MediaTypeIndicotorView.indicatorViewSize.height).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.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)
|
||||
|
||||
return playerViewController
|
||||
|
|
Loading…
Reference in New Issue