parent
bf8d694eb4
commit
c1f35a0ea6
|
@ -4,6 +4,7 @@
|
|||
|
||||
#import "ConversationInputToolbar.h"
|
||||
#import "ConversationInputTextView.h"
|
||||
#import "OWSMath.h"
|
||||
#import "Signal-Swift.h"
|
||||
#import "UIColor+OWS.h"
|
||||
#import "UIFont+OWS.h"
|
||||
|
@ -222,7 +223,7 @@ static void *kConversationInputTextViewObservingContext = &kConversationInputTex
|
|||
const CGFloat kMaxTextViewHeight = 100.f;
|
||||
const CGFloat textViewDesiredHeight = (self.inputTextView.contentSize.height + self.inputTextView.contentInset.top
|
||||
+ self.inputTextView.contentInset.bottom);
|
||||
const CGFloat textViewHeight = ceil(MAX(kMinTextViewHeight, MIN(kMaxTextViewHeight, textViewDesiredHeight)));
|
||||
const CGFloat textViewHeight = ceil(Clamp(textViewDesiredHeight, kMinTextViewHeight, kMaxTextViewHeight));
|
||||
const CGFloat kMinContentHeight = kMinTextViewHeight + textViewVInset * 2;
|
||||
|
||||
if (self.attachmentToApprove) {
|
||||
|
|
|
@ -173,6 +173,11 @@ class MediaMessageView: UIView, OWSAudioAttachmentPlayerDelegate {
|
|||
|
||||
private func addSubviewWithScaleAspectFitLayout(view: UIView, aspectRatio: CGFloat) {
|
||||
self.addSubview(view)
|
||||
// This emulates the behavior of contentMode = .scaleAspectFit using
|
||||
// iOS auto layout constraints.
|
||||
//
|
||||
// This allows ConversationInputToolbar to place the "cancel" button
|
||||
// in the upper-right hand corner of the preview content.
|
||||
view.autoCenterInSuperview()
|
||||
view.autoPin(toAspectRatio:aspectRatio)
|
||||
view.autoMatch(.width, to: .width, of: self, withMultiplier: 1.0, relation: .lessThanOrEqual)
|
||||
|
|
Loading…
Reference in New Issue