开发者

How to closw webView?

开发者 https://www.devze.com 2023-02-01 12:04 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消