原生滚轮组件,安卓IOS均为原生实现
安卓使用WheelPicker
IOS使用系统组件
npm install react-native-wheel-view-view
import { WheelViewView } from 'react-native-wheel-view-view';
// 高度不能为0
<WheelViewView
style={{ flex: 1 }}
data={['1', '2', '3', '4', '5']}
selectedIndex={selectedIndex}
onItemSelected={(event) => {
console.log(event.nativeEvent.data, event.nativeEvent.position, '选中的');
setSelectedIndex(event.nativeEvent.position);
}}
/>;
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library