Images flickering on iOS


HI all,

Here is my issue:
in my view I have ion card with a ngFor loop. inside the card i have 2 images. In my code it’s like that
array {title: “”, img : “”} and I reload the content/ data each 30s. Of course to avoid multiple push I empty the array first and then push.
In the iOS device, the images a flickering/ blinks (between the array == 0 and array = newData)… nothing on Android…
How can i disable this?!! Please help


<ion-card *ngFor="let top3data of top3fosts; let idx=index" >
  <img *ngIf="top3data.profile.pic != null" class="imgprofileFostLive" src="{{top3data.profile.pic}}">

> this.top3FostsList = [];
> this.trendyFostsList = [];

http.get … {
this.top3data = top3FostsList;


What does that mean?


it means:
this.dataServices.timerTrendyFost = setInterval(() => {
}, 30000);

I just refresh the data


I’m not entirely sure what this means, but it seems wasteful and a potential source of your problem. As a user, I would also prefer something like <ion-infinite-scroll> to your 30 second polling. I want to be in control of when new data is fetched; I don’t want periodic jankiness.


I also still don’t understand what you are doing and how it works, which is what etc.
You either explain it more and better, or I won’t be able to help you.


Well, I a have to refresh the feed of my app… So I getMyFeed each 30s since i dont have any socket or other communication between Client/Server.
Well I ended up to avoid that

this.oldData = newData

For now, inside my foreach i do

this.oldData[i].profile = newData[i].profile
this.oldData[i].likes = newData[i].likes

Dont forget the check if a new feed has been added

if (this.oldData[i[) { … } else { this.oldData.push(newData[i])

Just to avoid Image flickering on iOS. Pain in the ass. You can thanks the guy in this post

If anyone avoided to do in such weird way, please let me know


I still don’t understand why you do not let the user decide when to do this.


yes it would be better. But We agreed like that for now. We have position/ ranking. So its better to see it live.
But maybe we will change in a near future