我有一个UIWebView
加载div,充当编辑器来写。现在我添加UIWebView
为子视图UIWindow
以将框架设置为全屏并隐藏UIKeyboard
,但在某些按钮方法中,我需要从中获取UIWebview
并将UIWindow
其发送回UIKeyboard
。这是我的代码不起作用:
keyboardWindowFrame= nil;
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows])
{
if (![[testWindow class] isEqual:[UIWindow class]])
{
keyboardWindowFrame = testWindow;
[webViewForEditing setFrame:CGRectMake(5, 63, 310, 400)];
[webViewForEditing.scrollView setContentSize:CGSizeMake(310, 400)];
[keyboardWindowFrame addSubview:webViewForEditing];
break;
}
}
- (IBAction)keyboardButtonSelected:(id)sender
{
[keyboardWindowFrame sendSubviewToBack:webViewForEditing]; //need to send UIWebView back to UIWindow so i can write
}