【发布时间】:2020-07-09 00:54:10
【问题描述】:
我想显示类别列表。
Android 9 及以上版本不显示图像。
当我尝试放置静态图像时,它显示完美,但未显示来自服务器的图像。
在离子服务上,它按预期显示图像。
回复:
[{"categoryId":"1","name":"常规 知识","图片":"http://codehub.biz/knowledgeup/API/images/gk_categaries_icons.png"},{"categoryId":"3","name":"生物学","图片":" http://codehub.biz/knowledgeup/API/images/biology_categaries_icons.png"},{"categoryId":"4","name":"Chemistry","image":"http://codehub.biz/ Knowledgeup/API/images/Chemastry_Categaries_Icons.png"},{"categoryId":"5","name":"Economy","image":"http://codehub.biz/knowledgeup/API/images/Economy。 png"},{"categoryId":"6","name":"Sports","image":"http://codehub.biz/knowledgeup/API/images/sports_categaries_icons.png"},{"categoryId" :"7","name":"Physics","image":"http://codehub.biz/knowledgeup/API/images/physics.png"},{"categoryId":"8","name" :“世界 地理","图片":"http://codehub.biz/knowledgeup/API/images/geo.png"},{"categoryId":"10","name":"科学 & 发明","图片":"http://codehub.biz/knowledgeup/API/images/science.png"}]
tab1.html
<ion-grid>
<ion-row class="margin" *ngFor="let row of grid">
<ion-col size="3" class="ion-text-center" *ngFor="let item of row" (click)="quizInfo(item.categoryId,item.name)">
<img class="logo" [src]='item.image'> <br>
<!-- <img src="../../assets/icon/bio.png" class="logo"> <br> -->
<p class="margin title">{{item.name}}</p>
</ion-col>
</ion-row>
</ion-grid>
这是我用于显示列表的 html。
图片未显示
第一张图片是 android 版本 9 和 android 版本 7
【问题讨论】:
-
你添加的图片是以http://...的形式保存在db中还是只是图片名称?
标签: android angular image ionic-framework ionic4