Absolute layout for inner views doesn't work
See original GitHub issueI need to have backdrop background for some modal views - i.e. inner view overlaps parent using ‘absolute’ position and full-screen dimensions. It worked well with ReactNative 0.6.0, but now doesn’t - it just fills parent view. Here is example - instead of full black screen you will see just 200x100 black area.
How to achieve this goal with new version? Maybe i’ve missed some breaking changes for 0.8.0…
<View style={{flex:1,alignItems: 'center',justifyContent: 'center'}}>
<Text>Hello world!</Text>
<View style={{width:200,height:100,backgroundColor:'red'}}>
<View style={{position:'absolute',top:0,left:0,bottom:0,right:0, backgroundColor:'black'}}/>
</View>
</View>
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Absolute layout Scroll view Does not working - MSDN - Microsoft
A ScrollView that you want to fill an AbsoluteLayout needs to specify: AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" ...
Read more >Why tap gesture recognizer wont work in absolute layout?
Only images in the bottom of the screen show and others are overlapping by these two AbsoluteLayout, so the tap gesture recognizer wont...
Read more >Absolute Layout With Example In Android Studio
Tutorial on Absolute Layout with example and code in Android Studio. Also find out why it is depreciated in Android.
Read more >Android Layout - LinearLayout, RelativeLayout - DigitalOcean
AbsoluteLayout : allows us to specify the exact location of the child views and widgets; TableLayout : is a view that groups its...
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 >
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 Free
Top 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
Also I recommend that you use a top-level Navigator instead of Modal. Modal was designed for use in hybrid applications where you have a React Native view embedded in a UINavigationController, and want the React Native code to present a screen on top of the UINavigationController.
With pure React Native, you can simply use a top-level Navigator (wrap your entire app in a scene of this top-level Navigator) and present a modal screen by pushing a scene onto the top-level Navigator’s scene stack with the FloatFromBottom config.
tl;dr: If you are writing a React Native app whose root view is an RCTRootView, do not use Modal. Instead, use Navigator with the “FloatFromBottom” scene config.
Could you clarify? How to use truly modularized “react” approach with current react-native layout behavior? I want to have “modal” component which could be used from other component. This way i can’t put it to ‘top-view’ as suggested above, it brokes idea of components.