非常教程

React native参考手册

Components: Picker

Picker

在iOS和Android上呈现本地选取器组件。例:

<Picker
  selectedValue={this.state.language}
  onValueChange={(itemValue, itemIndex) => this.setState({language: itemValue})}>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

道具

ViewPropTypes道具...

onValueChange?: function

回调选择项目的时间。这用以下参数调用: - itemValuevalue所选项目的道具 - itemPosition:此选取器中所选项目的索引

selectedValue?: any

其中一个项目的值匹配值。可以是一个字符串或一个整数。

style?: pickerStyleType

testID?: string

用于在端到端测试中定位此视图。

androidenabled?: bool

如果设置为false,则选择器将被禁用,即用户将无法进行选择。

androidmode?: enum('dialog', 'dropdown')

在Android上,指定用户在选取器上轻击时如何显示选择项目:

  • '对话框':显示一个模式对话框。这是默认设置。
  • 'dropdown':显示锚定到选取器视图的下拉菜单

androidprompt?: string

提示此选取器的字符串,在Android上以对话框模式用作对话框的标题。

iositemStyle?: itemStylePropType

适用于每个项目标签的样式。

Components: Picker相关

React native

React Native 是一个 JavaScript 的框架,用来撰写实时的、可原生呈现 iOS 和 Android 的应用。

主页 https://facebook.github.io/react-native/
源码 https://github.com/facebook/react-native
发布版本 0.49

React native目录

1.开始 | Getting Started
2.指南 | Guides
3.APIs
4.组件:ActivityIndicator | Components: ActivityIndicator
5.组件:按钮 | Components: Button
6.组件:CheckBox | Components: CheckBox
7.组件:DatePickerIOS | Components: DatePickerIOS
8.组件:DrawerLayoutAndroid | Components: DrawerLayoutAndroid
9.组件:FlatList | Components: FlatList
10.组件:图像 | Components: Image
11.组件:KeyboardAvoidingView | Components: KeyboardAvoidingView
12.Components: ListView
13.Components: MaskedViewIOS
14.Components: Modal
15.Components: NavigatorIOS
16.Components: Picker
17.Components: PickerIOS
18.Components: ProgressBarAndroid
19.Components: ProgressViewIOS
20.Components: RefreshControl
21.Components: ScrollView
22.Components: SectionList
23.Components: SegmentedControlIOS
24.Components: Slider
25.Components: SnapshotViewIOS
26.Components: StatusBar
27.Components: Switch
28.Components: TabBarIOS
29.Components: TabBarIOS.Item
30.Components: Text
31.Components: TextInput
32.Components: ToolbarAndroid
33.Components: TouchableHighlight
34.Components: TouchableNativeFeedback
35.Components: TouchableOpacity
36.Components: TouchableWithoutFeedback
37.Components: View
38.Components: ViewPagerAndroid
39.Components: VirtualizedList
40.Components: WebView
41.创建 | Contributing
42.指南(Android) | Guides (Android)
43.指南(IOS) | Guides (iOS)
44.其他 | Miscellaneous