您的位置:首页 > 移动开发

IOS -TOWebViewController使用简介

2015-09-22 20:32 447 查看
官方介绍: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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: