I made a UIView which is located at the very bottom, and if a keyboard appears, the UIView responds and rises along with the keyboard - Everything is done on constants and with some simple code that sets the keyboard height to a constant to raise this wonderful UIView.

The question is how to make it so that if I create a new line, the UITextView itself expands in height, like UIView, and this whole thing automatically rests on the keyboard without any indents (as in the screenshot).

ios

    1 answer 1

    1) Turn off the textroll scroll.

    2) In the delegate (in the method shouldChangeTextInRange) in the dispatch_after block you set the size of the textView by content (sizeThatFits method).

    3) You set the height of textView.superview equal to the height of textView.

    4) Press textView.superview to the bottom of vc.view (if it is already compressed under the keyboard).

    5) Squeeze the table to the remaining height.