2015-12-22 71 views
1

我在我的應用程序中使用離子選項卡模板&有一個頁面的完整圖像,該圖像得到形式的JSON響應。如何顯示離子應用程序的整頁圖像

這裏是我的html代碼

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

我的問題是如何處理在不同的設備上的圖像分辨率。 如果任何一個有想法,請與我分享

+0

[this](http://codepen.io/rdelafuente/pen/tJrik)可能會有幫助。 –

+1

你不必擔心解決辦法,CSS可以適合你。看看這個鏈接:https://css-tricks.com/perfect-full-page-background-image/ – Nirus

+0

謝謝css技巧對我的問題非常有用 –

回答

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

我不知道這是最好的方法,但它的工作原理!

相關問題