2017-08-31 64 views
2

如何創建反應本機屏幕截圖上的菜單?反應本機模式底部菜單

enter image description here

+1

你可以嘗試https://github.com/beefe/react-native-actionsheet – Jayasagar

+0

我發現了一個更好的跨平臺解決方案:https://github.com/beefe/react-native-actionsheet – Tony

回答

1

你可以設置的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> 
+0

我認爲這種類型的菜單是iOS中的本地組件,因爲我在很多應用程序中看到它。我錯了嗎? – Tony