iOS 上带有 Firestore 的 Ionic 5 在新数据上向上滚动
Ionic 5 with Firestore on iOS scrolls up on new data
我正在使用 snapshotChanges()
[Angular Firestore] 监听 Firestore 的变化,并基于此显示和隐藏一些数据。
在 Android 和 Chrome 上,一切都按预期工作,但是在 Safari/iOS(真实设备、浏览器和模拟器)上,每次更改视图时,如果我之前滚动过,它就会向上滚动在页面下方。
<section *ngIf="!showl" style="margin-bottom: 120px; margin-top: 250px;">
<div *ngIf="dvid" style="z-index: -100;">
<div *ngFor="let telemetria of telemetrias">
<ion-card mode="ios" (click)="openIceSetting();">
</ion-card>
<ion-card *ngIf="telemetria.estado != '0' && telemetria.estado != '1'">
</ion-card>
<ion-card *ngIf="telemetria.estado != '0' && telemetria.estado != '1' && telemetria.estado != '2'">
</ion-card>
</div>
</div>
</section>
我不确定这是 Ionic 错误还是以前有人遇到过。
此外,我删除了 *ngFor
中的所有卡片和组件,只显示了纯数据并且效果很好,它不会向上滚动:
<section *ngIf="!showl" style="margin-bottom: 120px; margin-top: 250px;">
<div *ngIf="dvid" style="z-index: -100;">
<div *ngFor="let telemetria of telemetrias">
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
</div>
</div>
</section>
我已经举报了 here. For me this is a bug. However, to anyone that faces this problem, I've fixed it by using 。
我正在使用 snapshotChanges()
[Angular Firestore] 监听 Firestore 的变化,并基于此显示和隐藏一些数据。
在 Android 和 Chrome 上,一切都按预期工作,但是在 Safari/iOS(真实设备、浏览器和模拟器)上,每次更改视图时,如果我之前滚动过,它就会向上滚动在页面下方。
<section *ngIf="!showl" style="margin-bottom: 120px; margin-top: 250px;">
<div *ngIf="dvid" style="z-index: -100;">
<div *ngFor="let telemetria of telemetrias">
<ion-card mode="ios" (click)="openIceSetting();">
</ion-card>
<ion-card *ngIf="telemetria.estado != '0' && telemetria.estado != '1'">
</ion-card>
<ion-card *ngIf="telemetria.estado != '0' && telemetria.estado != '1' && telemetria.estado != '2'">
</ion-card>
</div>
</div>
</section>
我不确定这是 Ionic 错误还是以前有人遇到过。
此外,我删除了 *ngFor
中的所有卡片和组件,只显示了纯数据并且效果很好,它不会向上滚动:
<section *ngIf="!showl" style="margin-bottom: 120px; margin-top: 250px;">
<div *ngIf="dvid" style="z-index: -100;">
<div *ngFor="let telemetria of telemetrias">
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
<h1>telemetria.estado </h1>
</div>
</div>
</section>
我已经举报了 here. For me this is a bug. However, to anyone that faces this problem, I've fixed it by using