android - Xamarin Android - 无法访问绑定 Java 库的某些方法?
问题描述
我正在尝试使用通过 Nuget 安装的此 Xamarin 绑定在 Visual Studio 17 中使用Android Java 库CompactCalendarView 。在大多数情况下,函数可以工作,我可以使用设计器添加 CompactCalendarViews。但是,有些方法似乎不存在。我正在尝试在创建的日历视图上使用该方法,但 Visual Studio 给出了 CS1061 错误说明getFirstDayOfCurrentMonth()
'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?)
有问题的代码如下(从此处修改):
TextView monthAndYear = FindViewById<TextView>(Resource.Id.monthYearDisplay);
monthAndYear.SetText(dateFormatForMonth.Format(eventCalendarView.GetFirstDayOfCurrentMonth()));
dateFormatForMonth
对象在哪里Java.Text.SimpleDateFormat
。
我using
对所有三个已定义的包(base、.Domain 和 .Comparators)都有声明,但它不能解决这个问题。
任何和所有的帮助表示赞赏!
解决方案
正如 SushiHangover 所说,Xamarin 将方法调用转换为我能够访问的属性。
推荐阅读
- apache-spark - 加入已经在键子集中分区的 PySpark SQL 数据帧
- trace32 - 劳特巴赫脚本:检查函数名称和参数数据类型
- python - Python创建一个只读包装类而不修改包装类
- shell - Jenkins 执行选项卡
- javascript - 使用 Javascript 获取和使用 Python 请求获取之间的关系
- java - 通过从 JavaScript fetch API 接收 Spring MVC ModelAndView 进行重定向
- c++ - c++ 在 Visual Studio 2019 游戏窗口中显示黑屏 Windows 10
- autocomplete - CKEditor insertHtml outputTemplate
- node.js - 如何在 TypeScript 中导出库?
- typescript - 什么是类中的“at-syntax”