Xamarin Android - 无法访问绑定Java库的某些方法?

问题描述 投票:0回答:1

我正在尝试使用通过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()));

其中dateFormatForMonthJava.Text.SimpleDateFormat对象。

我有三个已定义的包(base,.Domain和.Comparators)的using语句,但它不能解决这个问题。

任何和所有的帮助表示赞赏!

android xamarin android-library
1个回答
0
投票

正如SushiHangover所说,Xamarin将方法调用转换为我能够访问的属性。

© www.soinside.com 2019 - 2024. All rights reserved.