反应原生模态底部的边距

时间:2021-04-24 14:16:17

标签: react-native react-native-modal

即使边距为 0,我也会在 React Native modal 的底部获得边距,请帮我解决这个问题

代码:

<Modal style = {{margin:0}} isVisible = {imageModal} onBackButtonPress={()=> setImageModal(false)} onBackDropPress={()=> setImageModal(false)} >
   <View style = {{height:win.height, width:win.width, flex:1, alignItems:"center"}}>
      <FlatList
         data = {imgs}
         horizontal={true}
         keyExtractor={(item, index) => item + index}
         renderItem={({item, index})=>{
          console.log(item, 'item')
            return(
             <View style ={{height: win.height * 0.7, width: win.width * 0.85, marginHorizontal:win.width * 0.075, marginTop:80,  alignItems:"center"}}>
                 <Image style = {{height:'90%' , width:'100%', resizeMode:"contain"}} source ={{uri:item.uri}} />
                 <Text style = {{fontFamily:"Poppins-Regular", fontSize:14, color:"white", marginTop:10}}>{index + 1} of {imgs.length}</Text>
             </View>
             )
           }}
      />
      <TouchableOpacity style={{height: 40, width: 40, backgroundColor: 'white', justifyContent: 'center', alignItems: "center", borderRadius:20, position:"absolute", top:  win.height * 0.85 }} onPress={() =>setImageModal(false)}><Icon2 name = 'cross' color = 'black' size={30}/></TouchableOpacity>
   </View>
</Modal>

check out this image

0 个答案:

没有答案