#607 Use safe areas for image preview
This commit is contained in:
parent
1e80643735
commit
e2e93bdaf0
|
@ -46,10 +46,10 @@ extension MediaPreviewImageViewController {
|
|||
previewImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(previewImageView)
|
||||
NSLayoutConstraint.activate([
|
||||
previewImageView.frameLayoutGuide.topAnchor.constraint(equalTo: view.topAnchor),
|
||||
previewImageView.frameLayoutGuide.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||
previewImageView.frameLayoutGuide.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
||||
previewImageView.frameLayoutGuide.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
||||
previewImageView.frameLayoutGuide.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
|
||||
previewImageView.frameLayoutGuide.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
|
||||
previewImageView.frameLayoutGuide.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
|
||||
previewImageView.frameLayoutGuide.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
|
||||
])
|
||||
|
||||
tapGestureRecognizer.addTarget(self, action: #selector(MediaPreviewImageViewController.tapGestureRecognizerHandler(_:)))
|
||||
|
|
|
@ -65,7 +65,7 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
|
|||
let initialFrame = transitionItem.initialFrame ?? toViewEndFrame
|
||||
let transitionTargetFrame: CGRect = {
|
||||
let aspectRatio = transitionItem.aspectRatio ?? CGSize(width: initialFrame.width, height: initialFrame.height)
|
||||
return AVMakeRect(aspectRatio: aspectRatio, insideRect: toView.bounds)
|
||||
return AVMakeRect(aspectRatio: aspectRatio, insideRect: toView.bounds.inset(by: toView.safeAreaInsets))
|
||||
}()
|
||||
let transitionImageView: UIImageView = {
|
||||
let imageView = UIImageView(frame: transitionContext.containerView.convert(initialFrame, from: nil))
|
||||
|
|
Loading…
Reference in New Issue