日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線(xiàn)溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)React教程:iOS日期選擇器

使用 DatePickerIOS 來(lái)在 iOS 上呈現(xiàn)一個(gè)日期/時(shí)間選擇器(selector)。這是一個(gè)控制組件,所以為了組件更新,你必須鉤在 onDateChange 回調(diào)中,并更新 date 支持,否則用戶(hù)的變化將立即恢復(fù)以反映 props.date。

Props

Edit on GitHub

date 日期型

當(dāng)前選中的日期。

maximumDate 日期型

最大的日期。

限制可能的日期/時(shí)間值的范圍。

minimumDate 日期型

最小的日期。

限制了可能的日期/時(shí)間值的范圍。

minuteInterval 枚舉型(1,2,3,4,5,6,10,12,15,20,30)

可選擇的分鐘的間隔。

mode 枚舉型(“date”,“time”,“datetime”)

日期選擇器模式。

onDateChange 函數(shù)型

日期變更處理程序。

當(dāng)用戶(hù)更改了 UI 的日期或時(shí)間時(shí),它就會(huì)被調(diào)用。第一個(gè)也是唯一一個(gè)參數(shù)是一個(gè) Date 對(duì)象,代表了新的日期和時(shí)間。

timeZoneOffsetInMinutes 數(shù)字型

在幾分鐘內(nèi)時(shí)區(qū)偏移。

默認(rèn)情況下,日期選擇器將使用設(shè)備的時(shí)區(qū)。有了這個(gè)參數(shù),才有可能迫使某個(gè)時(shí)區(qū)偏移。例如,為了顯示太平洋的標(biāo)準(zhǔn)時(shí)間,傳遞 -7 * 60。

例子

Edit on GitHub

'use strict';var React = require('react-native');var {
  DatePickerIOS,
  StyleSheet,
  Text,
  TextInput,
  View,
} = React;var DatePickerExample = React.createClass({
  getDefaultProps: function () {    return {
      date: new Date(),
      timeZoneOffsetInHours: (-1) * (new Date()).getTimezoneOffset() / 60,
    };
  },
  getInitialState: function() {    return {
      date: this.props.date,
      timeZoneOffsetInHours: this.props.timeZoneOffsetInHours,
    };
  },
  onDateChange: function(date) {    this.setState({date: date});
  },
  onTimezoneChange: function(event) {    var offset = parseInt(event.nativeEvent.text, 10);    if (isNaN(offset)) {      return;
    }    this.setState({timeZoneOffsetInHours: offset});
  },
  render: function() {    // Ideally, the timezone input would be a picker rather than a
    // text input, but we don't have any pickers yet :(
    return (      
        
          {
            this.state.date.toLocaleDateString() +
            ' ' +
            this.state.date.toLocaleTimeString()
          }
        
        
          
           hours from UTC
        
        
        
        
        
        
        
      
    );
  },
});var WithLabel = React.createClass({
  render: function() {    return (      
        
          
            {this.props.label}          
        
        {this.props.children}      
    );
  }
});var Heading = React.createClass({
  render: function() {    return (      
        
          {this.props.label}        
      
    );
  }
});
exports.title = '';
exports.description = 'Select dates and times using the native UIDatePicker.';
exports.examples = [
{
  title: '',
  render: function(): ReactElement {    return ;
  },
}];var styles = StyleSheet.create({
  textinput: {
    height: 26,
    width: 50,
    borderWidth: 0.5,
    borderColor: '#0f0f0f',
    padding: 4,
    fontSize: 13,
  },
  labelContainer: {
    flexDirection: 'row',
    alignItems: 'center',
    marginVertical: 2,
  },
  labelView: {
    marginRight: 10,
    paddingVertical: 2,
  },
  label: {
    fontWeight: '500',
  },
  headingContainer: {
    padding: 4,
    backgroundColor: '#f6f7f8',
  },
  heading: {
    fontWeight: '500',
    fontSize: 14,
  },
});

分享標(biāo)題:創(chuàng)新互聯(lián)React教程:iOS日期選擇器
網(wǎng)站路徑:http://m.5511xx.com/article/dhjegcs.html