我创建了一个 IONIC/Angular JS 应用程序;我想在上面加载一个网页,就像使用 Android WebView 一样;也就是说,在我的 ionic 应用程序的一个分区中显示我的网页。那么问题来了,有没有一个IONIC组件可以做到这一点呢?
最佳答案
我知道您不久前发布了这个问题。我同样需要在 ionic 页面中嵌入网页,我找到的解决方案是添加 iframe 标签。设置源以转到要嵌入的链接。iframe 将包含应用程序内的网页。您甚至可以创建一个 Controller 来添加更多功能。请参阅下面的代码:
<ion-view>
<ion-content class= 'padding has-subheader'>
<iframe class= 'webPage' name= "eventsPage" src="http://www.algonquincollege.com/studentsupportservices/events/">
</iframe>
</ion-content></ion-view>
对于样式设置,您需要使用 ionic 自动创建的滚动类来定位 div。例如,我想让网页填充90%的宽度。参见下面的代码:
ion-content div.scroll{
height: 90%; }
.webPage{
width: 100%;
height: 100%;
border: 2px solid #EAAB00;
padding: 1rem;}
希望这有帮助。 完整详细信息在这里:http://mobileapplicationsdesigndevelopment.blogspot.ca/
关于angularjs - Android Webview 相当于 ionic 框架中的什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28374056/