mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
make sure mediaview isn't too tall in detail view
// FREEBIE
This commit is contained in:
parent
411de65b40
commit
2c20cb9e7b
2 changed files with 17 additions and 1 deletions
|
@ -300,7 +300,7 @@ class MessageDetailViewController: OWSViewController, UIScrollViewDelegate {
|
|||
}
|
||||
|
||||
if let mediaMessageView = mediaMessageView {
|
||||
mediaMessageView.autoPinToSquareAspectRatio()
|
||||
mediaMessageView.autoMatch(.height, to: .width, of: mediaMessageView, withOffset:0, relation: .lessThanOrEqual)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,8 +172,16 @@ public class MediaMessageView: UIView, OWSAudioAttachmentPlayerDelegate {
|
|||
let stackView = wrapViewsInVerticalStack(subviews: subviews)
|
||||
self.addSubview(stackView)
|
||||
fileNameLabel?.autoPinWidthToSuperview(withMargin: 32)
|
||||
|
||||
// We want to center the stackView in it's superview while ensuring
|
||||
// it's superview is big enough to contain it.
|
||||
stackView.autoPinWidthToSuperview()
|
||||
stackView.autoVCenterInSuperview()
|
||||
NSLayoutConstraint.autoSetPriority(UILayoutPriorityDefaultLow) {
|
||||
stackView.autoPinHeightToSuperview()
|
||||
}
|
||||
stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual)
|
||||
stackView.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0, relation: .greaterThanOrEqual)
|
||||
}
|
||||
|
||||
private func createAnimatedPreview() {
|
||||
|
@ -286,8 +294,16 @@ public class MediaMessageView: UIView, OWSAudioAttachmentPlayerDelegate {
|
|||
let stackView = wrapViewsInVerticalStack(subviews: subviews)
|
||||
self.addSubview(stackView)
|
||||
fileNameLabel?.autoPinWidthToSuperview(withMargin: 32)
|
||||
|
||||
// We want to center the stackView in it's superview while ensuring
|
||||
// it's superview is big enough to contain it.
|
||||
stackView.autoPinWidthToSuperview()
|
||||
stackView.autoVCenterInSuperview()
|
||||
NSLayoutConstraint.autoSetPriority(UILayoutPriorityDefaultLow) {
|
||||
stackView.autoPinHeightToSuperview()
|
||||
}
|
||||
stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual)
|
||||
stackView.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0, relation: .greaterThanOrEqual)
|
||||
}
|
||||
|
||||
private func createHeroViewSize() -> CGFloat {
|
||||
|
|
Loading…
Reference in a new issue