在iOS上使用UIWebView的多标签Web浏览器 [英] multi-tab web browsers with UIWebView on iOS

查看:118
本文介绍了在iOS上使用UIWebView的多标签Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个简单的Web浏览器。
我希望我的用户能够同时添加标签和浏览许多网页,例如Safari,Firefox或Chrome。
我已经完成了这个并且效果很好,但我不知道是否有更简单的方法可以做到这一点。

I'm creating a simple web browser. I want my users to add tabs and browse many web pages at the same time, like in Safari, Firefox or Chrome. I've done this and it works great but I don't know if there is a simpler way to do this.

当用户添加新的时候选项卡,我的应用程序在后台创建一个与新选项卡相关的新UIWebView并加载新的URL。当用户选择另一个选项卡时,将显示与此选项卡相关的UIWebView,另一个选项消失。只是它..

When the user adds a new tab, my application creates a new UIWebView in the background that is related to the new tab and loads a new URL. When the user selects another tab, the UIWebView that is related with this tab appears and the other disappears. Just it..

推荐答案

我会使用UIViewController将制表符作为父视图控制器。每个选项卡都与包含UIWebView的子UIViewController相关联。当您单击其他选项卡或创建新选项卡时,您只需隐藏当前子UIViewController的视图并显示新视图。

I would use a UIViewController with the tabs as a parent view controller. Each tab would be associated with a child UIViewController containing a UIWebView. When you click on a different tab or create a new one, you can just hide the current child UIViewController's view and show the new one.

这篇关于在iOS上使用UIWebView的多标签Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆