【问题标题】:Back application page, from uiwebview返回应用程序页面,来自 uiwebview
【发布时间】:2026-02-15 01:45:02
【问题描述】:

我称之为:

    NSString *authLink = @"https://plus.google.com/share?url=http://*.com";
NSURL *url = [NSURL URLWithString:authLink];    

[vkWebView loadRequest:[NSURLRequest requestWithURL:url]];

在我发送文本后,UIWebView 加载了我的 google+ 墙。如何隐藏 webview 并返回到我的应用程序?

【问题讨论】:

  • 如何显示UIWebView?你想什么时候回到你的应用程序?在网络视图中显示数据之后?在用户执行某些操作之后?
  • if ([[URL absoluteString] isEqualToString:@"plus.google.com/"]) { [super dismissModalViewControllerAnimated:YES]; return NO; } 在 - (BOOL)webView:(UIWebView *)aWbView shouldStartLoadWithRequest 中调用:(NSURLRequest *)请求导航类型:(UIWebViewNavigationType)导航类型

标签: ios uiwebview google-plus


【解决方案1】:

您可以使用webView:shouldStartLoadWithRequest:navigationType: 委托方法查看 UIWebView 尝试加载的 url。

详情请见http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIWebViewDelegate

当您获得 google+ 墙的 URL 时,只需隐藏/停止 UIWebView

【讨论】:

    最近更新 更多