sghiassy / react-native-sglistview

SGListView is a memory minded implementation of React Native's ListView
MIT License
743 stars 72 forks source link

There is a bug when sliding up rapidly #12

Open lmllml opened 8 years ago

lmllml commented 8 years ago

When I slide down, everything is normal. But when I slide up rapidly, there are some blank around item.

0439b43f-88e3-4c0c-98ba-9c9f7af9d345

rreusser commented 8 years ago

@liyandalmllml - we were having the same problem (see #2 #4 #5 #9 #10) so I created a fork that used a completely different method for testing visibility. This branch and commit should fix that issue. There is a pul request here: #10. To use:

"react-native-sglistview": "git://github.com/rreusser/react-native-sglistview.git#d962a66ef70a7f4920bf9f96260b26032233d060"

Really though, the correct solution for us was to turn on removeClippedSubviews={true} (see this page). This option is superior if it works and is now enabled by default for this reason. If it works for you, I would recommend it. If not, then I recommend my branch.

sghiassy commented 8 years ago

removeClippedSubviews={true} will work for you @lmllml.

But @rreusser, I don't think removeClippedSubviews works for all situations. I believe if you have a row with an image in it. You'll still want to use this library over removeClippedSubviews.

lmllml commented 8 years ago

@rreusser @sghiassy Thanks for reply. I hava test turn on removeClippedSubviews={true}, but It looks like have little effect. It is true memory is not straight up, but also bumps increase. As rows increase, memory usage is not acceptable. Post my code and memory data graph below. Is there any mistakes? 1 2 3 4 Later I will test @rreusser's branch, see whether it is effective.

sghiassy commented 8 years ago

You have removeClippedSubviews in your props twice, but I doubt that's causing any problems. The code looks good to me.

Outside of the rendering bug, did SGListView solve your memory problems?

Interested to hear your findings.