2017-08-31 62 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