闲来无事开发了个日期选择控件,感兴趣的同学前往:
GitHub - MatoApps/Mato.DatePicker: 一个适用于Xamarin.Forms的日期选择控件
Mato.DatePicker
说明
- 这是一个带有农历日历的日期选择Xamarin控件
- 可以指定初始日期
- 多选和单选日期
引用
- PCL:NuGet Gallery | Mato.DatePicker.PCL 1.0.0.1
- Android:NuGet Gallery | Mato.DatePicker.Android 1.0.0
- iOS: NuGet Gallery | Mato.DatePicker.iOS 1.0.0
用法
- 在引用iOS安装包时候需要在
AppDelegate.cs
做如下操作:
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
...
global::Xamarin.Forms.Forms.Init();
Mato.DatePicker.iOS.ChinaDateServer ssChinaDateServer=new Mato.DatePicker.iOS.ChinaDateServer(); //在此插入这段语句
LoadApplication(new App());
}
同样的,在引用Android安装包后,需要在MainActivity.cs
做如下操作:
protected override void OnCreate(Bundle bundle)
{
...
global::Xamarin.Forms.Forms.Init(this, bundle);
DatePicker.Android.ChinaDateServer ssChinaDateServer = new DatePicker.Android.ChinaDateServer(); //在此插入这段语句
LoadApplication(new App());
}