{"_id":"skyinno-webview","_rev":"35-264546d77632e2a37f6293062ac4960b","name":"skyinno-webview","time":{"modified":"2022-06-26T20:39:47.176Z","created":"2017-02-25T07:39:16.861Z","1.1.1":"2017-02-25T07:39:16.861Z","1.1.2":"2017-02-25T07:42:31.159Z","1.1.3":"2017-02-25T07:51:57.361Z","1.1.4":"2017-02-25T07:54:51.556Z","1.2.0":"2017-02-25T08:05:21.726Z","1.0.0":"2017-02-25T08:55:19.147Z","1.3.0":"2017-02-25T09:00:33.370Z","1.5.0":"2017-02-25T09:27:31.688Z","1.6.0":"2017-02-25T10:24:16.601Z","1.6.1":"2017-02-25T10:46:11.936Z","1.6.4":"2017-02-26T12:16:46.976Z","1.6.5":"2017-02-26T12:33:10.490Z","1.6.6":"2017-02-26T12:42:24.084Z","1.6.7":"2017-02-26T12:48:54.264Z","1.6.8":"2017-02-26T12:52:47.643Z","1.6.9":"2017-02-26T12:54:21.152Z","1.7.0":"2017-02-26T13:14:49.684Z","1.4.0":"2017-03-01T02:37:37.494Z","1.4.1":"2017-03-01T03:17:14.285Z"},"maintainers":[{"name":"bigwit","email":"bigwit@126.com"}],"dist-tags":{"latest":"1.2.0"},"description":"React native cross platform picker.","readme":"# react-native-wheel-picker\n[![npm version](http://img.shields.io/npm/v/react-native-wheel-picker.svg?style=flat-square)](https://npmjs.org/package/react-native-wheel-picker \"View this project on npm\")\n[![npm version](http://img.shields.io/npm/dm/react-native-wheel-picker.svg?style=flat-square)](https://npmjs.org/package/react-native-wheel-picker \"View this project on npm\")\n\n## Introduction\nCross platform Picker component based on React-native.\n\nSince picker is originally supported by ios while Android only supports a ugly Spinner component. If you want to have the same user behaviour, you can use this.\n\nThe android component is based on https://github.com/AigeStudio/WheelPicker which runs super fast and smoothly. It also supports curved effect which make it exactly the same looking and feel as the ios picker.\n![](https://raw.githubusercontent.com/lesliesam/react-native-wheel-picker/master/demo.gif)\n![](https://raw.githubusercontent.com/lesliesam/react-native-wheel-picker/master/demo_android.gif)\n\n## How to use\n\nRun command\n\nFor apps using RN 0.32 or higher, please run\n```\nnpm i react-native-wheel-picker --save\n```\nFor apps using RN 0.31 or less, please run\n```\nnpm install --save --save-exact react-native-wheel-picker@1.0.1\n```\nAdd in settings.gradle \n```\ninclude ':react-native-wheel-picker'\nproject(':react-native-wheel-picker').projectDir = new File(settingsDir, '../node_modules/react-native-wheel-picker/android')\n```\nAdd in app/build.gradle\n```\ncompile project(':react-native-wheel-picker')\n```\nModify MainActivity\n```\n    import com.zyu.ReactNativeWheelPickerPackage;\n    ......\n    \n    protected List<ReactPackage> getPackages() {\n        return Arrays.<ReactPackage>asList(\n            new MainReactPackage(), new ReactNativeWheelPickerPackage()\n        );\n    }\n```\n\n## Example code\n```\nimport React from 'react'\n\nimport {\n  AppRegistry,\n  Component,\n  StyleSheet,\n  Text,\n  View\n} from 'react-native';\n\nimport Picker from 'react-native-wheel-picker'\nvar PickerItem = Picker.Item;\n\n\n\nvar AwesomeProject = React.createClass({\n  \n  getInitialState: function() {\n    return {\n      selectedItem : 2,\n      itemList: ['刘备', '张飞', '关羽', '赵云', '黄忠', '马超', '魏延', '诸葛亮']\n    }\n  },\n\n  onPikcerSelect: function(index) {\n    this.setState({\n      selectedItem: index,\n    })\n  },\n\n  onAddItem: function() {\n    var name = '司马懿'\n    if (this.state.itemList.indexOf(name) == -1) {\n      this.state.itemList.push(name)\n    }\n    this.setState({\n      selectedItem: this.state.itemList.indexOf(name),\n    })\n  },\n\n  render: function() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>\n          Welcome to React Native!\n        </Text>\n        <Picker style={{width: 150, height: 180}}\n          selectedValue={this.state.selectedItem}\n          itemStyle={{color:\"white\", fontSize:26}}\n          onValueChange={(index) => this.onPikcerSelect(index)}>\n            {this.state.itemList.map((value, i) => (\n              <PickerItem label={value} value={i} key={\"money\"+value}/>\n            ))}\n        </Picker>\n        <Text style={{margin: 20, color: '#ffffff'}}>\n          你最喜欢的是：{this.state.itemList[this.state.selectedItem]}\n        </Text>\n\n        <Text style={{margin: 20, color: '#ffffff'}}\n            onPress={this.onAddItem}>\n          怎么没有司马懿？\n        </Text>\n      </View>\n    );\n  }\n});\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#1962dd',\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n    color: '#ffffff',\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 5,\n  },\n});\n\nAppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);\n```\n","versions":{"1.2.0":{"name":"skyinno-webview","version":"1.2.0","description":"React native cross platform picker.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/lesliesam/react-native-wheel-picker.git"},"keywords":["react-native","picker","wheel"],"author":{"name":"Huai"},"license":"ISC","bugs":{"url":"https://github.com/lesliesam/react-native-wheel-picker/issues"},"homepage":"https://github.com/lesliesam/react-native-wheel-picker#readme","dependencies":{},"_id":"skyinno-webview@1.2.0","_shasum":"0ed0bb8fa6cd0dfb7a9ca9a4172c6e0b315ac834","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"bigwit","email":"bigwit@126.com"},"dist":{"shasum":"0ed0bb8fa6cd0dfb7a9ca9a4172c6e0b315ac834","tarball":"https://registry.npmjs.org/skyinno-webview/-/skyinno-webview-1.2.0.tgz","integrity":"sha512-33cM16c+lERTeT7X/c8yXlqZ/WdWqgqGGLoHfQLfGfKXpCTTNZxLefTinBJvQkVIuS5JuJZPTtMrF6/eiSnDnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqfsAtHqEHxM17DhqWLM2JJLSjkvWofo3avroCr0qROAiBUCDB44OnZWv/gmajgFyAAJ6cJhK2E/0C8J4948y/POg=="}]},"maintainers":[{"name":"bigwit","email":"bigwit@126.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/skyinno-webview-1.2.0.tgz_1488009921497_0.7712998583447188"}}},"author":{"name":"Huai"},"license":"ISC","readmeFilename":"README.md","homepage":"https://github.com/lesliesam/react-native-wheel-picker#readme","keywords":["react-native","picker","wheel"],"repository":{"type":"git","url":"git+https://github.com/lesliesam/react-native-wheel-picker.git"},"bugs":{"url":"https://github.com/lesliesam/react-native-wheel-picker/issues"}}