非常教程

React native参考手册

APIs

DatePickerAndroid

打开标准的Android日期选择器对话框。

try {
  const {action, year, month, day} = await DatePickerAndroid.open({
    // Use `new Date()` for current date.
    // May 25 2020. Month 0 is January.
    date: new Date(2020, 4, 25)
  });
  if (action !== DatePickerAndroid.dismissedAction) {
    // Selected year, month (0-11), day
  }
} catch ({code, message}) {
  console.warn('Cannot open date picker', message);
}

方法

static open(options)

打开标准的Android日期选择器对话框。

options对象的可用键是:

  • dateDate以毫秒为单位的对象或时间戳) - 默认显示的日期
  • minDateDate或以毫秒为单位的时间戳) - 可以选择的最短日期
  • maxDateDate对象或时间戳,以毫秒为单位) - 可以选择的最大日期
  • modeenum('calendar', 'spinner', 'default')) - 将日期选择器模式设置为日历/微调器/默认
    • 'calendar':以日历模式显示日期选择器。
    • 'spinner':以微调模式显示日期选择器。
    • 'default':显示基于android版本的默认本地日期选择器(微调器/日历)。

返回一个无极将包含要调用的对象actionyearmonth(0-11),day如果用户选择了一个日期。如果用户放弃了对话,那么Promise仍然会在动作存在的情况下解决,DatePickerAndroid.dismissedAction而所有其他的键都是未定义的。经常检查action之前是否读取数值。

请注意,使用minDatemaxDate选项时,本机日期选取器对话框在Android 4及更低版本中会出现一些UI故障。

static dateSetAction()

日期已被选中。

static dismissedAction()

该对话已被解雇。

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