Is it possible to open up a WebView
inside of an AlertDialog
on iPhone? If you wouldn't mind providing an example I would be very appreciative.
Asked
Active
Viewed 621 times
1

Dharmesh Dhorajiya
- 3,976
- 9
- 30
- 39

steven
- 698
- 3
- 8
- 32
-
2You want to add a web view to a UIAlertView? Don't do that! UIAlert view is not meant to be extensively modified (look at [UIAlertView documentation's "Subclassing Notes" section](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAlertView_Class/UIAlertView/UIAlertView.html)). My suggestion would be to create your own UIView with a WebView inside it and then present it modally – Michael Dautermann Dec 31 '11 at 17:42
-
@Michael Dautermann It was my only idea for placing these ads so they are easy to get rid of. I'm using Leadbolt and using an App Wall. The problem with it is if it is just a webview it takes over the screen and they can't get to a section in my app without it being in the way. On Android I added an alert box and placed the webview in so they could just dismiss the ad with a simple button click. Any alt ideas to accomplish that? A button on the webview to exit the webview – steven Dec 31 '11 at 18:26
1 Answers
1
Reading your comments, I have to echo the sentiment that you really don't want to do that! Possible, sure, but very much against Apple's guidelines and harder than you need. Just load a UIWebView
modally, like Words With Friends does, and use either a UIButton
inserted into the view in the corner or bottom to dismiss it. The view could even be a fullscreen UIView
with a UIWebView
and UIButton
inserted into the view to make the hierarchy make more sense. Any questions about how to accomplish this? Happy to give more information.

Dylan Gattey
- 1,713
- 13
- 34