即时尝试使键盘出现时,UIWebView的大小也会发生变化,因此可以在屏幕上显示。
代码似乎适用于工具栏,但不适用于webview。
这是我的代码:
- (void) repositionControllers
{
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGRect toolbarFrame = toolbar.frame;
CGRect WebviewFrame = Webview.frame;
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
CGFloat screenHeight = screenSize.height;
toolbarFrame.origin.y = screenHeight - 216 - toolbarFrame.size.height;
toolbar.frame = toolbarFrame;
WebviewFrame.size.height = screenHeight - 216 - toolbarFrame.size.height;
Webview.frame = WebviewFrame;
}
谁能看到我在这里做错了什么?