【问题标题】:How to dispaly full page image in ionic app如何在离子应用程序中显示整页图像
【发布时间】:2015-12-22 16:43:15
【问题描述】:

我正在使用离子标签模板,在我的应用程序中有一个包含完整图像的页面,该图像获取表单 json 响应。

这是我的html代码

<ion-content class="padding">
    <img src="{{img}}" alt="" class="full-image">
</ion-content>

我的问题是如何处理不同设备中的图像分辨率。 如果有人有想法,请与我分享

【问题讨论】:

标签: javascript css angularjs ionic-framework ionic


【解决方案1】:

我想处理不同设备中的图像,我在控制器中完成了这个:

 $scope.width=$window.innerWidth*0.65;//65% of the width
//change the percentage to fit your goals

 $scope.height=$window.innerHeight*0.65; //65% of the height
//change the precentage to fit your goals

并在 .html 中像这样使用它:

<img ng-src={{image.src}} height={{height}} width={{width}} />

我不知道这是否是最好的方法,但它确实有效!

【讨论】:

    猜你喜欢
    • 2017-12-22
    • 2019-12-15
    • 1970-01-01
    • 1970-01-01
    • 2019-12-18
    • 1970-01-01
    • 1970-01-01
    • 2011-02-25
    • 2023-03-04
    相关资源
    最近更新 更多