2013-10-29 150 views
1

的多個事件,我想在我的應用程序創建的事件一起顯示日曆。我能夠將它添加到視圖。突出顯示CalendarView

LinearLayout calendarLayout = (LinearLayout) view.findViewById(R.id.calendarLayout); 

CalendarView calendarView = new CalendarView(mActivity); 
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); 
calendarView.setLayoutParams(layoutParams); 

Calendar calendar = Calendar.getInstance(); 
calendar.set(2013, 9, 10, 14, 10); 

calendarView.setDate(calendar.getTimeInMillis(), true, true); 

calendarLayout.addView(calendarView); 

但是,我無法突出顯示多個事件。嘗試過幾個社區帖子;他們工作不太好。有什麼想法嗎?

回答

0

隨着MFCalendarView,您可以突出顯示多個事件。

ArrayList<String> eventDays = new ArrayList<String>(); 
eventDays.add("2014-02-25"); 
eventDays.add(Util.getCurrentDate()); 

mf.setEvents(eventDays); 
+0

我用你的庫項目。尼斯的工作,但有是,當我接着說:eventdays List'和'mf.setEvents(eventDays)',並顯示它工作正常的日曆,但最終當我改變月份它沒有顯示你正在使用'dots'熒光筆問題它... – XtreemDeveloper