Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在ionic应用程序中显示整版图像_Javascript_Css_Angularjs_Ionic Framework_Ionic - Fatal编程技术网

Javascript 如何在ionic应用程序中显示整版图像

Javascript 如何在ionic应用程序中显示整版图像,javascript,css,angularjs,ionic-framework,ionic,Javascript,Css,Angularjs,Ionic Framework,Ionic,我使用的是爱奥尼亚标签模板&在我的应用程序中有一个带有完整图像的页面,该图像从json响应中获取 下面是我的html代码 <ion-content class="padding"> <img src="{{img}}" alt="" class="full-image"> </ion-content> 我的问题是如何在不同的设备中处理图像分辨率。 如果有人有想法,请与我分享我想在不同的设备中处理图像,我在控制器中做到了这一点: $scope.w

我使用的是爱奥尼亚标签模板&在我的应用程序中有一个带有完整图像的页面,该图像从json响应中获取

下面是我的html代码

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

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

我想在不同的设备中处理图像,我在控制器中做到了这一点:

 $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}} />


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

可能会有帮助。!你不必担心分辨率,CSS可以适合你。看看这个链接:谢谢css技巧对我的问题非常有用