diff --git a/Sources/InputTextView.swift b/Sources/InputTextView.swift index 3ad14d88..9d622995 100644 --- a/Sources/InputTextView.swift +++ b/Sources/InputTextView.swift @@ -75,6 +75,17 @@ open class InputTextView: UITextView { updateConstraintsForPlaceholderLabel() } } + + open override var scrollIndicatorInsets: UIEdgeInsets { + didSet { + if scrollIndicatorInsets == .zero { + scrollIndicatorInsets = UIEdgeInsets(top: .leastNonzeroMagnitude, + left: .leastNonzeroMagnitude, + bottom: .leastNonzeroMagnitude, + right: .leastNonzeroMagnitude) + } + } + } public weak var messageInputBar: MessageInputBar? @@ -98,7 +109,10 @@ open class InputTextView: UITextView { font = UIFont.preferredFont(forTextStyle: .body) textContainerInset = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4) - scrollIndicatorInsets = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4) + scrollIndicatorInsets = UIEdgeInsets(top: .leastNonzeroMagnitude, + left: .leastNonzeroMagnitude, + bottom: .leastNonzeroMagnitude, + right: .leastNonzeroMagnitude) isScrollEnabled = false layer.cornerRadius = 5.0 layer.borderWidth = 1.25 diff --git a/Sources/MessagesViewController.swift b/Sources/MessagesViewController.swift index 384b0920..caf922cf 100644 --- a/Sources/MessagesViewController.swift +++ b/Sources/MessagesViewController.swift @@ -61,6 +61,11 @@ open class MessagesViewController: UIViewController { setupDelegates() } + + open override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + messageInputBar.inputTextView.setNeedsDisplay() + } open override func viewDidLayoutSubviews() { // Hack to prevent animation of the contentInset after viewDidAppear