【发布时间】:2013-07-08 10:01:26
【问题描述】:
嗨,我有 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;
但是屏幕变成了这样:
【问题讨论】:
-
你不是在stackoverflow.com/questions/17513713/…,问过同样的问题吗?
-
是的,但我问错了问题。
标签: iphone ios keyboard uitextview