本教程的实现效果如下:
为了实现其淡入/淡出的覆盖效果, 还有取消按钮, 在此用了一个三方的组件, 大家可以先安装一下:
三方组件的地址:https://github.com/eyaleizenberg.../react-native-custom-action-sheet (可以看看,也可以直接按我的步骤走)
1....,
TouchableHighlight,
DatePickerIOS
} from 'react-native';
//这是一个三方组件 github地址:https://github.com.../eyaleizenberg/react-native-custom-action-sheet
var CustomActionSheet = require('react-native-custom-action-sheet...: 10,
},
});
AppRegistry.registerComponent('Demo', () => Demo);
写好了,在terminal中运行:react-native run-ios