![](/img/trans.png)
[英]IOS, UIWebView, HTTPS, and Trusting Arbitrary Certificate (Open Source Reference?)
[英]iOS: UIWebView full open source browser?
有谁知道是否有任何使用 UIWebview 构建完整浏览器的开源解决方案? 当您通过 URL 时, Three20 中有类似的东西,但我假设那里必须有其他替代方案。
我意识到 UIWebView 是 web 浏览器,但连接刷新、后退按钮、URL 栏等需要额外的时间。
建议?
SVWebViewController看起来很像您正在寻找的东西。
https://github.com/ghostery/banshee
编辑项目现在在这里维护: https://github.com/acatighera/banshee
它是一个带有标签、书签、搜索等功能的开源浏览器。
我已经启动了一个开源项目(MIT 许可证),以尽可能接近原生 MobileSafari 应用程序(在 iPhone 和 iPad 上)。
以下是迄今为止的功能:
欢迎任何想为这个项目做出贡献的人来做!
您可以在此处克隆/分叉该项目: https://github.com/sylverb/CIALBrowser
UIWebView
是一个完整的浏览器! 要在 webView 中打开webView
,请执行以下操作 -
NSURL *url = [NSURL URLWithString:webAddress];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[webView loadRequest:req];
您甚至可以将 javascript插入UIWebView
。 您可以根据自己的喜好对其进行自定义。
//To customize the look & feel...
self.webView.scalesPageToFit = YES;
self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.webView.autoresizesSubviews = YES;
//To insert Javascript
NSString *jsCommand = [NSString stringWithFormat:@"document.body.style.zoom = 0.5;"];
[self.webView stringByEvaluatingJavaScriptFromString:jsCommand];
你可以做的更多。 玩得开心...
更新:要获得后退按钮和所有功能, webView
提供了这些功能,后退、前进等所有这些浏览器功能。 您需要编写按钮和 UI 以及可以执行此操作的代码 -
-(IBAction)goForward:(id)sender
{
[webView goForward];
}
-(IBAction)goBack:(id)sender
{
[webView goBack];
}
-(IBAction) gotoHome:(id)sender
{
NSString *urlAddress = @"http://google.com";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
}
您还可以查看 KINWebBrowser,它是您应用程序的 web 浏览器模块中的一个插件。 https://github.com/dfmuir/KINWebBrowser
特征
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.