Akila

Akila

  • NA
  • 216
  • 34.5k

react-native bring sub view to front

Nov 23 2021 4:31 AM

Hi,

I am using popup menu for the post if i click the menu the menu box will appear behind the image .How can i put the popup to the front.

<Text style={styles.uploadtitle}>{item.upload_title}</Text>
<View style={styles.setimage}>
<Image style={styles.feedImage} source={feedpostimage}  />
</View>
<View style={styles.menu} >
  <MenuProvider style={styles.menucontainer}>
  <View>
    <Menu style={{marginLeft:300}}>
      <MenuTrigger><Image source={require("../components/assests/more2.png")} /></MenuTrigger>
      <MenuOptions >
        <MenuOption  text="Edit" />
        <MenuOption onSelect={() => alert(`Delete`)}>
          <Text style={{ color: 'red' }}>Delete</Text>
        </MenuOption>  
      </MenuOptions>
    </Menu>
  </View>
</MenuProvider>
</View> 

CSS

setimage: {
  flex: 1,
   height: 275,
   width: "100%",
 },
 feedImage: {
   height: 250,
   borderRadius: 2,
   resizeMode: "stretch",
 },
 menu:{
   position: 'absolute',
   top:10,
   left:30
  },
  menuoption:{
  marginTop:30
  },
 menucontainer:{
   flex: 1,
   paddingTop: 20,
    elevation:1000, 
    zIndex:1000
 },

 


Answers (1)