Question: Why default to full screen height instead of allowing dynamic height?
See original GitHub issueWhich OS ?
Both
Version
Which versions are you using:
- react-native-swiper v1.6.0.rc
- react-native v0.62.2
Problem / Question
In the implementation, it is setting the initial height
state to window height if we do not provide a height
prop to it.
In order to place the swiper perfectly, I would need to calculate the height and width of the content beforehand which is kind of unnecessary work.
Wouldn’t it be more flexible to not do anything with the initial height and let the container fit dynamically with the content? We can always control the dimension ourselves.
PS. If there’s a way to have dynamic height control already that I missed, please let me know thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:5
Top Results From Across the Web
html - Make a div fill the height of the remaining screen space
So here, what am doing is, adding up the height of elements and than deducting from 100% using calc() function. Just make sure...
Read more >HTML vs Body: How to Set Width and Height for Full Page Size
Yes, yes it does. The above style definition creates a problem: Setting min-height to 100% on both elements does not allow the body...
Read more >How to give a div tag 100% height of the browser window ...
How to give a div tag 100% height of the browser window using CSS ... CSS allows to adjust the height of an...
Read more >background-size - CSS: Cascading Style Sheets | MDN
The background-size CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, ...
Read more >Size and Lay Out Your Dashboard - Tableau Help
Fixed size dashboards let you specify the exact location and position of the ... Automatic: The dashboard automatically resizes to fill the window...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I build a workaround by using onLayout in the child views: (The largest child defines the height of the Swiper)
Anyone to answer this, please? It’s a great package, but setting hardcoded dimensions complicates everything.