- How to specifiy modal height react native navigation? It default stretches full screen, how to stretch it half screen?
- Can the drawer be shown from the bottom?
Asked
Active
Viewed 7,281 times
1
-
2Hi and welcome to StackOverflow. Please refer to https://stackoverflow.com/help/how-to-ask on how to ask a proper question and improve yours according the guidelines. As a first step, please add the code you already tried and describe how it doesnt work for you. – Fabian S. Jan 23 '18 at 12:35
-
you could add some examples? – jasinth premkumar Jan 23 '18 at 12:51
1 Answers
1
If you are asking for Modal in react native, you can proceed below.
1 - To reduce the modal height, you can specify the height inside the most parent View element
<View style={{height: 60%}}>
Also you can import Dimensions and use it to get screen's height and width as below,
import { Dimensions } from 'react-native';
const window = Dimensions.get('window');
const screenHeight = window.height;
const screenWidth = window.width;
and then you can use this screenHeight and screenHeight into your css.
<View style={{height: screenHeight - 80}}> // Any values
2 - Anything's possible and yes we can do that in react native too. But first they are called as ActionSheets(as in iOS) / BottomSheets(as in android). You can check these libraries for android and ios or both.
https://github.com/beefe/react-native-actionsheet (Both)
https://github.com/cesardeazevedo/react-native-bottom-sheet-behavior (Android)
https://github.com/eyaleizenberg/react-native-custom-action-sheet (iOS)

HSBP
- 735
- 2
- 8
- 22