Masonry/Pinterest columns using React Native

前端 未结 2 1668
半阙折子戏
半阙折子戏 2021-02-15 23:34

Is there some way to use flexbox in React Native to achieve a Masonry / Pinterest style columns?

2条回答
  •  走了就别回头了
    2021-02-15 23:56

    I guess theres no way to tackle this until react-native returns width/height for network images. Also flex doesnt seem to wrap child elements with different heights properly. Theres space above/below smallers cells.

    You can still achieve a pinterest result, if you were to user two columns side by side and apply arbitrary height to child elements. Would only work for single orientation and with set number of columns.

    just for fun : https://github.com/antigirl/ReactNativeFakeMasonary

提交回复
热议问题