嗨,我有 UITextView,我希望它的高度正好在键盘上方。我正在制作一个笔记应用程序,我需要启动 UITextView 以便它轻松滚动。这是代码:
CGRect keyboardBounds = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGRect frame = self.notesTextView.frame;
CGFloat height = self.notesTextView.frame.size.height;
height = frame.size.height;
frame.size.height -= keyboardBounds.size.height;
self.notesTextView.frame = frame;
然而画面变成了这样: