npm i --save nativescript-timedatepicker-renet
- 版本:1.2.1
- GitHub:https://github.com/leocaseiro/nativescript-timedatepicker
- NPM:https://npmjs.net.cn/package/nativescript-timedatepicker-renet
- 下载
- 昨天:0
- 上周:0
- 上个月:0
nativescript-timedatepicker
一个为Android和iOS提供原生日期和时间选择器的NativeScript插件。
##Android端 ##iOS端
用法
//Import the plugin
import * as TimeDatePicker from 'nativescript-timedatepicker';
//Create a callback function
let mCallback = ((result) => {
if (result) {
alert("the time is "+result);
}
});
//Initialize the PickerManager (.init(yourCallback, title, initialDate))
TimeDatePicker.init(mCallback,null,null);
//Show the dialog
TimeDatePicker.showDatePickerDialog();
更多用法示例请查看演示 main-view-model.ts。
##致谢 此插件抽象了两个原生库,因此以下是项目和应得的荣誉归功于创建者。
对于iOS https://github.com/hackiftekhar/IQActionSheetPickerView
对于Android https://github.com/CiTuX/datetimepicker