Skip to content

Commit 5d30ee4

Browse files
jasonaibrahimrnystrom
authored andcommitted
Calculate scroll view frame correctly (#72)
* Update MessageViewController.swift Use use existing scrollview frame to calculate new frame values with offset from messageView * refactor
1 parent 5f700de commit 5d30ee4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

MessageViewController/MessageViewController.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ open class MessageViewController: UIViewController, MessageAutocompleteControlle
126126
// required for the nested UITextView to layout its internals correctly
127127
messageView.layoutIfNeeded()
128128

129+
let frame = scrollView.frame
129130
scrollView.frame = CGRect(
130-
x: bounds.minX,
131-
y: bounds.minY,
132-
width: bounds.width,
133-
height: messageViewFrame.minY
131+
x: frame.minX,
132+
y: frame.minY,
133+
width: frame.width,
134+
height: messageViewFrame.minY - frame.minY
134135
)
135136

136137
messageAutocompleteController.layout(in: view, bottomY: messageViewFrame.minY)

0 commit comments

Comments
 (0)