我将 presentModalViewController 用于我的“信息”视图。我在 NavigationController 的顶部添加了一个信息按钮,当按下它时,我调用此方法
about *ab = [[about alloc] initWithNibName:@"about" bundle:[NSBundle mainBundle]];
ab.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController: ab animated: YES];
[ab release];
在我的信息页面中有一个 UIWebView,其中包含一些链接。使用它(并将 uiwebview 委托设置为 self)
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
if (inType == UIWebViewNavigationTypeLinkClicked) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}
如果用户触摸一个链接,该链接将通过 safari 打开。
有什么问题?如果你这样做,然后你返回到应用程序,你不在信息视图中,而是在主视图中......并且(这是问题)如果你触摸信息按钮,什么也没有发生!您无法再次打开信息视图!
为什么?
谢谢!