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.

[Nested ViewPager] child ViewPager will not show without a specific height

See original GitHub issue

Environment

"react-native-pager-view": "^5.0.12"

System:
    OS: macOS 11.2.2
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 852.00 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.19.0 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 7.6.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 21, 23, 25, 26, 27, 28, 29
      Build Tools: 23.0.1, 26.0.1, 26.0.2, 27.0.3, 28.0.3, 29.0.2
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_212 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.64.0-rc.4 => 0.64.0-rc.4
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Description

      <ViewPager style={{flex: 1}}>
        <View style={{backgroundColor: 'grey'}}>
          <ViewPager style={{backgroundColor: 'red', height: 200}}> // black and yellow children will not show without height: 200
            <View style={{backgroundColor: 'black', height: 100}} />
            <View style={{backgroundColor: 'yellow', height: 100}} />
          </ViewPager>
        </View>
        <View style={{backgroundColor: 'gold'}} />
      </ViewPager>

Reproducible Demo

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
catalinmironcommented, Nov 14, 2021

Thank you so much @10000multiplier and @haibert ❤️

2reactions
haibertcommented, Nov 13, 2021

@10000multiplier actually I did 😄 The code for it is here but I believe you have to sign up for Catalin’s patreon to get access which believe me, is WELL worth it. Only 5 bucks a month… I want to help you but posting the code here would be cheating Catalin because he puts a lot of work into his patreon and youtube channel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set ViewPager Inside ScrollView without specifying it's height
I am trying to set view pager inside ScrollView but it's not showing without specifying specific height. <android.support.v4.widget.NestedScrollView android: ...
Read more >
Android ViewPager — Resize with every page - ProAndroidDev
In this method we simply checks if the current view is not in focus then update this to the view pager and resize...
Read more >
ViewPager with FragmentPagerAdapter - CodePath Cliffnotes
Overview. Layout that allows the user to swipe left and right through "pages" of content which are usually different fragments. This is a...
Read more >
ViewGroup - Android Developers
This widget is no longer supported. Other horizontally scrolling widgets include HorizontalScrollView and ViewPager from the support library.
Read more >
ViewPager.java - android Git repositories
Called when the adapter for the given view pager has changed. ... Since ViewPager. // children are always full-height, we do not want...
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