Content inside scroll view with contentInsetAdjustmentBehavior with incorrect height
See original GitHub issue🐛 Bug Report
It seems that scroll view doesn’t calculate properly the size of its container when contentInsetAdjustmentBehavior
is set to automatic
To Reproduce
Refer to this snack: https://snack.expo.io/r1XhuwVBV
When contentInsetAdjustmentBehavior
is set to automatic
, the container view get’s pushed from the top, but the container maintains the same height, so you have an extra scroll size that hides the bottom text.
For reference, same code with contentInsetAdjustmentBehavior
set to never
:
Expected Behavior
Content should just take the remaining space.
Code Example
https://snack.expo.io/r1XhuwVBV
Environment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 2.82 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.13.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 27, 28
Build Tools: 27.0.3, 28.0.3
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.4 => 0.58.4
npmGlobalPackages:
react-native-cli: 2.0.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:18 (1 by maintainers)
Top Results From Across the Web
UIScrollView excessive content height when setting contentInset
height exceeds scrollView.bounds.height with nothing forcing that. This only happens when contentView height is less than screen height. First ...
Read more >ScrollView - React Native
Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container ......
Read more >UIScrollView with Auto Layout implemented in Interface builder
There are stack overflow questions about getting a scrollview with dynamic width or height to, well, scroll. There is another guide on Medium...
Read more >How to control safe area insets in SwiftUI - FIVE STARS
struct ContentView: View { var body: some View { ScrollView { ForEach(1..<30) { _ in Text("Five Stars") .font(.
Read more >The height of content is incorrect… | Apple Developer Forums
1. When display text or html content with wkwebview, the height would be smaller than the actual height(the scroll bar will be displayed)....
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
Btw, this also happens when
contentInsetAdjustmentBehavior
isalways
.@1987cr cómo está lo más bonito de Sant Cugat?