ios - react-native 中的模态底部菜单

标签 ios react-native

我如何为 react-native 创建一个像屏幕截图一样的菜单?

enter image description here

最佳答案

你可以设置 backgroundColor: 'rgba(0,0,0,0.2)'。

<Modal
      animationType={"slide"}
      transparent={false}
      visible={this.state.modalVisible}
      onRequestClose={() => {alert("Modal has been closed.")}}

      >

     <View style={{flex: 1,backgroundColor: 'rgba(0,0,0,0.2)'}}>
      <View style ={{flex:1, alignItems: 'center', justifyContent: 'center'}}>
          <View style={{backgroundColor: '#ffffff', width: 300, height: 300}}>
              <Text>Hello World!</Text>
          </View>
        <TouchableHighlight
          style={{backgroundColor: '#ffffff', width: 300, height: 40, marginTop: 40}}
          onPress={() => {this.setModalVisible(!this.state.modalVisible)}}
        >
          <Text>Hide Modal</Text>
        </TouchableHighlight>

      </View>
     </View>
    </Modal>

关于ios - react-native 中的模态底部菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45990254/

相关文章:

javascript - React Native Redux Reducer 不工作

android - 蓝牙设备未在 android oreo 中列出

javascript - 访问引号内的函数

java - 如果两者都可用,Android BiometricManager 默认是人脸识别还是指纹识别?

ios - 应用程序批准后,iAd 测试广告会在 Xcode 中消失吗?

ios - UISegmentedControl 不尊重为 UIControlStateDisabled 设置的分隔图像

ios - Sprite kit - 处理快速序列中的重叠动画

javascript - 使用 useState 时如何减少 React 中的重复?

iphone - 如何将 nsmutable 数组添加到 sqlite 数据库表中

html - UITextView html 文本 - 引用项目中的字体