2010-05-06 51 views
2

我試圖在UIAlertview中插入UIWebview,因爲我的教程是使用表http://codesofa.com/blog/archive/category/iphone,我已經嘗試了代碼中的webview,但面對異常和我的程序在終止由於它。如何在UIAlertView中使用UIWebview iphone

+3

向我們展示了代碼和異常! – willcodejavaforfood 2010-05-06 12:06:02

+0

它應該工作,告訴我們你的代碼和你得到的警告,以便我們可以看到和幫助。 – texmex5 2010-05-06 12:06:29

+0

我一直在表內工作,而不是通過在其中添加子視圖單獨使用。 – Umaid 2010-05-06 15:27:25

回答

1
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"WebView" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil]; 
UIWebView *webView = [[UIWebView alloc] init]; 
[webViewn setFrame:CGRectMake(0,0,80,50)]; 
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"google.com"]]]; 
[alert addSubview:webView]; 
[webView release]; 
[alert show]; 
[alert release]; 

嘗試這樣的。