我已閱讀這裏的帖子,但無法完全適應他們的需求。我有:在XCode中檢測UIWebView表單提交
-(IBAction) abouthtml
{
NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"];
NSURL *url = [NSURL fileURLWithPath:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
CGRect webViewRect = frameWebSpace;
UIWebView *myWebPage=[[UIWebView alloc] initWithFrame:webViewRect];
[myWebPage loadRequest:requestObj];
[self.view addSubview:myWebPage];
}
這顯示細膩,但我的「返回程序」,在about.html提交按鈕無法正常工作。
我試過,在這裏發貼建議:
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request
navigationType:(UIWebViewNavigationType)navigationType
{
if (navigationType == UIWebViewNavigationTypeFormSubmitted)
{
....
但很明顯,沒有任何鏈接myWebPage到web視圖。有人可以建議我錯過了什麼嗎? 我是否需要讓webView成爲myWebPage的代表?心慌意亂,但是希望...