小编Cya*_*Cya的帖子

React Native Modal:透明背景和布局问题

我正在使用React Native Modal,我希望Modal的背景是透明的,并且我希望Modal显示代表屏幕

如何达到同样的要求,我哪里出错了?

下面是相同的代码,请看一下:

import React, { Component } from 'react'
import { Modal, View, Text, Dimensions, Platform, TouchableOpacity, Alert, StyleSheet, Button } from 'react-native'
import Icon from 'react-native-vector-icons/Entypo'

const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;

export class MyComponent extends Component {

    render = () => {
    const message = 'Do you want to upload the video now or wait until you are connected to wi-fi?'
    return (
      <Modal
        animationType='slide'
        transparent={true}
        style={{backgroundColor: 'black'}}
      >
        <View style={styles.content}>
          <View style={styles.closeBtn}> …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-modal

2
推荐指数
1
解决办法
9695
查看次数

标签 统计

react-native ×1

react-native-modal ×1