Android rendering children of View as separate pages
See original GitHub issueSummary
On Android, all children of children elements get rendered onto their own pages.
Environment info
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor
Memory: 166.43 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v12.18.0/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
IDEs:
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
npmPackages:
react: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
Library version: Expo 37.0.0
Steps to reproduce
import ViewPager from "@react-native-community/viewpager"
import React from "react"
import { View, Text } from "react-native"
export const MyComponent = () => {
return (
<ViewPager initialPage={0}>
<View key="1">
<Text>First page a</Text>
<Text>First page b</Text>
</View>
<View key="2">
<Text>Second page a</Text>
<Text>Second page b</Text>
</View>
</ViewPager>
)
}
Renders incorrectly on Android. I have 4 screens here that I can swipe through, but I expect only 2 screens with text underneath.
Renders correctly on iOS, with the Text being underneath each other.
Issue Analytics
- State:
- Created 3 years ago
- Comments:22 (2 by maintainers)
Top Results From Across the Web
Performance and view hierarchies - Android Developers
This page describes how to assess whether your view hierarchy is slowing your app down, and offers some strategies for addressing issues ...
Read more >Custom View Components | Android Developers
Android offers a sophisticated and powerful componentized model for building your UI, based on the fundamental layout classes: View and ...
Read more >Build a Responsive UI with ConstraintLayout
This page provides a guide to building a layout with ConstraintLayout in Android ... Each constraint represents a connection or alignment to another...
Read more >Relative Layout | Android Developers
RelativeLayout lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align...
Read more >Layouts - Android Developers
All elements in the layout are built using a hierarchy of View and ViewGroup objects. A View usually draws something the user can...
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
https://reactnative.dev/docs/view.html#collapsable
@taingmeng you are right. Maybe we should consider to add this property by default.
I didn’t have time to fight this but just to let anybody who reads this know, I switched to just basic screens with
react-navigation
and this half / incomplete navigation issue between screens went away.