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.

Android Scrollview ContentInset/ContentOffset do not behave properly.

See original GitHub issue

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest React Native release to make sure your issue has not already been fixed: https://reactnative.dev/docs/upgrading.html

Content Offset and Content Inset do not work for Android devices on React Native ScrollViews

React Native version:

Run react-native info in your terminal and copy the results here.

System: OS: macOS 10.15.7 CPU: (8) x64 Intel® Core™ i7-3770 CPU @ 3.40GHz Memory: 91.34 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.15.1 - /usr/local/bin/node Yarn: Not Found npm: 6.13.7 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /Users/Dellybro/.rvm/gems/ruby-2.6.3/bin/pod SDKs: iOS SDK: Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: Not Found IDEs: Android Studio: 3.5 AI-191.8026.42.35.5900203 Xcode: 12.1/12A7403 - /usr/bin/xcodebuild Languages: Java: 11.0.2 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.3 => 0.63.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Create a horizontal scrollview and attempt to use content inset and content offset. Nothing will happen

Expected Results

Describe what you expected to happen.

I would expect the same results as iOS with contentInset is moves the start and contentOffset is moves the initial starting value

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

https://stackoverflow.com/questions/65014040/react-native-android-scrollview-content-inset-content-offset-not-applied

Please review this stackoverflow question which has all of the information about my current situation.

Snack Expo link https://snack.expo.io/gW4iCCXOD

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
omaryoussefcommented, May 27, 2021

@fabriziobertoglio1987 It seems to only fix contentOffset but not contentInset. Can confirm contentInset is not working at all on Android.

7reactions
Hexo97commented, Aug 2, 2021

contentInset is still not working on Android. alternatively, you can pass style to contentContainerStyle. e.g. : contentContainerStyle={{ paddingBottom: 150 }}

Read more comments on GitHub >

github_iconTop Results From Across the Web

android scrollview not working - Stack Overflow
When I click edit text and keyboard is showing -- then I can't scroll.scrollview not working. What am I doing wrong? If anyone...
Read more >
ScrollView - Android Developers
Scroll view may have only one direct child placed within it. ... FOCUS_DOWN If the reference refers to a view that does not...
Read more >
React Native Android Scrollview - Content Inset ... - ADocLib
Component that wraps platform ScrollView while providing integration with touch locking responder system. On android this is not supported and it will have...
Read more >
Android Studio How to use scroll view (ScrollView) - YouTube
In this video I am going to show you how to:use scroll view ( scrollView ) in android studioin Android Studio Version ...
Read more >
How to Make Android Constraintlayout Scrollable ... - YouTube
Here are the steps: 1- Open up Android Studio. ... file and change the root layout from Android Constraintlayout to Scrollview.
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