简体   繁体   English

我如何在 react-native 中进行自定义日期选择器

[英]How can i do custom date picker in react-native

I had used date time picker in react native, but I want to do in my custom UI for the date picker.我曾在本机反应中使用日期时间选择器,但我想在我的自定义 UI 中为日期选择器做。 How can I do it?我该怎么做?

I want to do as shown in below image in both android and IOS我想在 android 和 IOS 中都如下图所示

*) Follow the below steps. *) 请按照以下步骤操作。

  1. Use new Dat e API to get Date , Month and Years store them in array.使用new Date e API 获取DateMonthYears将它们存储在数组中。
  2. then display in row so three are side to each other.然后按显示,使三个彼此相邻。
  3. Hide Top and Bottom Portion View Using overflow hidden使用溢出隐藏隐藏顶部底部视图

That is it you can generate a Date Picker like you side.那就是你可以像你身边一样生成一个日期选择器。

You can get that look by using the react-native-date-picker library and the following code:您可以通过使用react-native-date-picker库和以下代码来获得该外观:

<DatePicker
  date={date}
  onDateChange={setDate}
  mode="date"
/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 react-native 中制作自定义日期选择器? - How to make a custom date picker in react-native? react-native 选择器样式自定义字体 - react-native picker styling custom font react-native:我如何在模态中的某处进行导航 - react-native: how can I do a navigation somewhere in a modal 如何减少所选选项与react-native选择器中的下拉图标之间的空间? - How can I reduce the space between selected option and the dropdown icon in react-native picker? 如何从 react-native 中的 Picker onValueChange 获取 label - How can I get label from Picker onValueChange in react-native 我在使用react-native-image-picker进行react-native链接后是否运行pod update? - Do I run pod update after react-native link with react-native-image-picker? react-native如何在选择器中设置fontSize - react-native how to set fontSize in picker 如何在React-native中使用Picker设置setState? - How to setState with Picker in React-native? React-native - 如何创建一个无限选择器 - React-native - How to create a infinite picker 从 React-Native DateTimePicker 中选择日期后,如何使用日期值更改按钮标题? - How do I change the button title with the date value after a date is chosen from React-Native DateTimePicker?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM