小编Mal*_*eeb的帖子

如何使用 xaml 在 Xamarin 中显示当前时间

当我在 DatePicker 元素中使用DateTime.Today 时,它正在运行并为我提供正确的输出,但是当我在 TimePicker 元素中使用DateTime.Now 时,它会返回错误

  1. 错误 位置 17:21。无法分配属性“时间”:属性不存在,或不可分配,或值与属性之间的类型不匹配

主页.xaml

<DatePicker Date="{x:Static sys:DateTime.Today}" />
<TimePicker Time="{x:Static sys:DateTime.Now}" />
Run Code Online (Sandbox Code Playgroud)

c# asp.net xaml xamarin.forms

1
推荐指数
1
解决办法
933
查看次数

标签 统计

asp.net ×1

c# ×1

xamarin.forms ×1

xaml ×1