Answers for "set element bottom css react native"

2

react native component at bottom center

bottomCenter: {
    flex: 1,
    justifyContent: 'flex-end',
    marginBottom: 30
}
Posted by: Guest on December-16-2020
0

react native bottom sheet above the bottom menu

//Use this package 
//https://github.com/gorhom/react-native-portal

If you want to use sheet not modal


import { PortalProvider,Portal,PortalHost } from '@gorhom/portal';

 const App = () => {

   return (
     <SafeAreaProvider>
          <PortalProvider>
              <Navigation />
          </PortalProvider>
     </SafeAreaProvider>
   );
 };

 export default App;



=========================================
// now wrap the sheet  with Portal on your screen 


  <Portal>
    <BottomSheet
    ref={bottomSheetRef}
    index={-1}
    snapPoints={snapPoints}
    onChange={handleSheetChanges}
    >
      <View style={styles.contentContainer}>
        <Text style={styles.bottomSheetTitle}>Add Customer</Text>
  </View>
  </BottomSheet>
  </Portal>

<PortalHost name="custom_host" /> // Name to be used as an id
Posted by: Guest on September-06-2021

Code answers related to "set element bottom css react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language