url:samvermette_SVWebViewController
Three20带此浏览方式,如果只需要单一功能,不需要添加整个320项目。
源码包demo方法:
- (void)pushWebViewController { NSURL *URL = [NSURL URLWithString:@"http://www.cnblogs.com/maxfong/"]; SVWebViewController *webViewController = [[SVWebViewController alloc] initWithURL:URL]; [self.navigationController pushViewController:webViewController animated:YES]; } - (void)presentWebViewController { NSURL *URL = [NSURL URLWithString:@"http://www.cnblogs.com/maxfong/"]; SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:URL]; webViewController.modalPresentationStyle = UIModalPresentationPageSheet; webViewController.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsCopyLink | SVWebViewControllerAvailableActionsMailLink; [self presentModalViewController:webViewController animated:YES]; }
通过创建Toobar并操作mainWebView(UIWebView)的goBack、goForward、reload、stopLoading来操作web页的显示。
学到了相互引用.h,在SVModalWebViewController.m用category引用SVWebViewController.h文件。