本机模式底部菜单

Ton*_*ony 5 ios react-native

我如何创建像本机屏幕截图上的菜单一样的本机?

在此处输入图片说明

An *_*Cam 4

您可以设置背景颜色:'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>
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

6466 次

最近记录:

6 年,9 月 前