CalendarView icon indicating copy to clipboard operation
CalendarView copied to clipboard

使用getCurrentMonthCalendars 拿到的集合是空的。

Open ismisteryang opened this issue 5 years ago • 2 comments

如题 在xml中引入了自定义的周视图 月视图 ,代码中使用该方法获取整月的数据时拿到的集合是空的。 /** * 获取当前月份数据 * * @return 获取当前月份数据 */ List<Calendar> getCurrentMonthCalendars() { BaseMonthView view = (BaseMonthView) findViewWithTag(getCurrentItem()); if (view == null) { return null; } return view.mItems; } 打断点这个地方的view 是null 不清楚应该怎么初始化来避免这种情况?

ismisteryang avatar Dec 16 '19 07:12 ismisteryang

我遇到的情况是这样的,第一时间获取到的确实是null,规避解决下延迟10毫秒加载,就有当前月数据了,前提是日历已展示。

标记下,有个需求,想获取下个月或者往后几个月的日历集合数据,需要怎么做?

callhh avatar Dec 20 '19 03:12 callhh

如题 在xml中引入了自定义的周视图 月视图 ,代码中使用该方法获取整月的数据时拿到的集合是空的。 /** * 获取当前月份数据 * * @return 获取当前月份数据 */ List<Calendar> getCurrentMonthCalendars() { BaseMonthView view = (BaseMonthView) findViewWithTag(getCurrentItem()); if (view == null) { return null; } return view.mItems; } 打断点这个地方的view 是null 不清楚应该怎么初始化来避免这种情况?

用post方法

BugMen avatar Oct 05 '21 15:10 BugMen