IOS -TOWebViewController使用简介

      官方介绍:TOWebViewController 是在线 web 浏览视图控制器,可以用来快速显示 web 内容,自动基于设备的当前 iOS 版本自定义外观,能动态生成所有运行时需要的图像。兼容 iPhone 和 iPad,要求 iOS 5.0 及以上。

       下载地址:https://github.com/TimOliver/TOWebViewController

       使用TOWebViewController需要引用TOWebViewController.h头文件

#import "TOWebViewController.h"

      在.m文件中添加以下方法即可使用

            //注释部分是使用的UIWebView的方法
           // FinancialVC *finanVC =[[FinancialVC alloc]init];
           // self.navigationController pushViewController:finanVC animated:YES];
            //实例化并设置连接地址
            NSString *url = @"ww.apple.com/iphone";
            TOWebViewController *toweb = [[TOWebViewController alloc] initWithURL:[NSURL URLWithString:url]];
            //设置打开的动画效果,打开效果有如下四中:
            // 底部向上  UIModalTransitionStyleCoverVertical
            // 淡入     UIModalTransitionStyleCrossDissolve
            // 翻转     UIModalTransitionStyleFlipHorizontal
            // 翻半页   UIModalTransitionStylePartialCurl
            [toweb setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
            [self presentViewController:[[UINavigationController alloc]  initWithRootViewController:toweb]   animated:NO completion:nil];

 

posted @ 2015-09-22 20:32  errorbook  阅读(791)  评论(0编辑  收藏  举报