I am designing a webView with a close 开发者_Python百科button. When the application is launched, it opens the given url. When the button is touched, i want to close the webView.
I need some button event which closes the webView. Thank you for your answers.
UIWebView inherits from UIView. So the answer is: It depends!
If you're using a UINavigationController and used
[[self navigationController] pushViewController:newUIWebController];
you can close your UIView by using
[self.navigationController popViewControllerAnimated:YES];
If you're using some other method to display your view (like addSubView
) you can utilize the corresponding method like removeFromSuperview
.
精彩评论