tradingview / LightweightChartsIOS

Apache License 2.0
144 stars 48 forks source link

White blink on initialize of charts #42

Open makedonsky94 opened 2 years ago

makedonsky94 commented 2 years ago

The method clearWebViewBackground is not working properly so users still suffer from this problem.

Also we should consider to clear the background automatically

phsu-bc commented 2 years ago

We have implemented clearWebViewBackground on initialization of the chart view. We still see a flash of white, and also at times the background stays white even though we're in dark mode and we've configured the chart using dynamicProvider values.

Could you clarify "not working properly" and if the planned fix would potentially address the issues we're seeing?

makedonsky94 commented 2 years ago

clearWebViewBackground was intented to fix the blink on initialization of the view because this is an issue of WebView's native canvas. The white background on theme mode chage you see related to inner logic of the chart. I mean the background of js canvas is not synchronized with native mods. When you set a color to the background the library calculates value and marshal the color to js. At the moment if you need to update chart colors you need to send the color again