Open iqqmuT opened 1 year ago
+1 on this
better using FlatList to avoid inflate all view once time
This is kinda expected behaviour. A Masked View needs to render what it's displaying. If you have a 500x500px Masked View, it needs to render those 500x500 pixels. It does that only once, when created, and then stores the rendering to save performance.
Now when you instantiate 100 Masked Views you are in theory rendering a 50.000x500 display. Which your smartphone obviously can not handle.
That's why you use FlatList, like Fukemy said, because flatlist creates the components on the fly, while you scroll. Which will make the MaskedViews render one by one, once you need them.
But this is basic app Optimization and has nothing to do with MaskedView's bad performance...
Here is a simple app which runs very slow on Android phone:
Setting the
boxContainer
size affects the performance:100x100
: app runs smoothly200x200
: app is slow500x500
: app crashes