我正在尝试使用通过Nuget安装的CompactCalendarView在Visual Studio 17中使用Android Java库this Xamarin binding。在大多数情况下,函数工作,我可以使用设计器添加CompactCalendarViews。但是,似乎并不存在某些方法。我正在尝试在创建的日历视图上使用getFirstDayOfCurrentMonth()
方法,但Visual Studio提供了CS1061错误说明
'CompactCalendarView' does not contain a definition for 'GetFirstDayOfCurrentMonth' and no accessible extension method 'GetFirstDayOfCurrentMonth' accepting a first argument of type 'CompactCalendarView' could be found (are you missing a using directive or an assembly reference?)
有问题的代码如下(从here修改):
TextView monthAndYear = FindViewById<TextView>(Resource.Id.monthYearDisplay);
monthAndYear.SetText(dateFormatForMonth.Format(eventCalendarView.GetFirstDayOfCurrentMonth()));
其中dateFormatForMonth
是Java.Text.SimpleDateFormat
对象。
我有三个已定义的包(base,.Domain和.Comparators)的using
语句,但它不能解决这个问题。
任何和所有的帮助表示赞赏!
正如SushiHangover所说,Xamarin将方法调用转换为我能够访问的属性。