brh55 / react-native-masonry

:raised_hands: A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
MIT License
1.32k stars 157 forks source link

Add dynamic parent view / parent view styled-container #21

Closed brh55 closed 7 years ago

brh55 commented 7 years ago

Currently react-native-masonry is under the assumption that the view isn't going to be constrained by padding around it's component main view. However, any padding will result in incorrect calculations of image dimensions. To fix this, dynamically pass the parents available dimensions to the columns to use as a base measurement.

Validate:

brh55 commented 7 years ago

Oppose to having a container prop, users should wrap the component with their own view as the grid is already transparent, and it supports padding offsets.