My code was working fine under iOS 6, but under iOS 7 I can't seem to make my UITextView the height of the device's screen minus the keyboard (in other words, when the keyboard is up, have the UITextView still be fullscreen, but not go under the keyboard).
For one, when I put the UITextView in my view controller (which is embedded in a navigation controller) it has to be under the nav bar as well, otherwise it starts too far down.
From there I tried all of these examples:
self.textView.contentInset = UIEdgeInsetsMake(0, 0, 230, 0);
self.textView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 230, 0);
self.textView.textContainerInset = UIEdgeInsetsMake(0, 0, 230, 0);
Where in each the keyboard still goes over the textview at some points. I also tried setting a height constraint and manipulating the constant, but no luck.
self.height.constant = self.height.constant - 240.0;
(Where height
is the constraint's outlet.)
These have all been tried before and after a [self.textField becomeFirstResponder];
call.
How am I to accomplish this? I just want a full screen UITextView where the caret thing won't go under the keyboard, but it such basic functionality seems crazy under iOS 7.