ionic-content 中iframe高度自适应

http://blog.csdn.net/jesounao/article/details/50945003
无法访问外部url的问题–两个步骤解决:
1.iframe的src属性用ng-src属性替代,并指明绑定对象:ng-src="{{targetUrl}}"

2.在controller里,调用$sce: $scope.targetUrl = $sce.trustAsResourceUrl(url)

高度无法最大化的问题–两个步骤:
1.ion-content 属性里添加 scroll="true" overflow-scroll="true"

2.iframe的style里添加 min-height: 100%

<ion-modal-view>
    <ion-header-bar>
        <h1 class="title">无法登录</h1>
        <div class="buttons">
            <button class="button" ng-click="closeModal()">取消</button>
        </div>
    </ion-header-bar>
    <ion-content scroll="true" overflow-scroll="true">
        <iframe src="http://www.zehuiwenhua.com/guoxue/content.html?k=guoxue-content-cannot-login" frameborder="0" style="width:100%;height:100%;"></iframe>
    </ion-content>
</ion-modal-view>

posted @ 2018-03-20 11:05  CooMark  阅读(1056)  评论(0编辑  收藏  举报