iphone开发学习,开源之SVWebViewController,UIWebView支持后退、前进、刷新、使用Safari打开...

呼延河
2023-12-01

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文件。

转载于:https://www.cnblogs.com/maxfong/archive/2012/05/15/2501513.html

 类似资料: