简体   繁体   中英

Image on Ionic2/3 app html page

In Ionic2/3 Typescript application:

I got display of my image(s) successfully this way:

    <ion-item>
      <ion-avatar item-start>
        <img src="{{imgPath}}">
      </ion-avatar>
    </ion-item>

But it is blank squares if I put it in ion-img :

    <ion-img src="{{imgPath}}"></ion-img>

You should specify the image dimensions. I made a simple example here

  <ion-img width="80" height="80" src="{{test}}"></ion-img>

in ts file:

test ="https://i.imgur.com/FMo96fW.jpg";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM