question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

screen shot 2019-02-15 at 17 26 01

For reference, same code with contentInsetAdjustmentBehavior set to never:

screen shot 2019-02-15 at 17 25 47

Expected Behavior

Content should just take the remaining space.

screen shot 2019-02-15 at 17 45 06

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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dani-mpcommented, Jun 17, 2020

Btw, this also happens when contentInsetAdjustmentBehavior is always.

1reaction
dani-mpcommented, Mar 9, 2022

@1987cr cómo está lo más bonito de Sant Cugat?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found