简体   繁体   中英

Is it possible to override the android CalendarView methods?

I created an android calendar widgets. but I'm just wondering.. is it possible to override the method of CalendarView? what I really wanted is to display only the current month and daygridview not the previews days and next month days.. and I also want to remove the scrollView that allow the user to scroll up and down for the previous and next month.. I just want to have a simple calendar... Is there any body can help me please?..

this is the CalendarView that I wanted to customized..

XML CalendarView ScreenShoots

So then make a class that extends CalendarView and override according methods. There should not be a problem with it.

You could just create a gridView and set the # of columns as 7 for the # of days. Create an adapter that would then extend BaseAdapter. And in that class, you could set the # of grid cells as 42 as the max. possible grid cells is 7*6. Once done, as part of the getView() method, you could create a textview for each grid cell and fill that with the day of the month.

For setting the weekdays at the top, you could create another gridView with the same specs and set that as the headerView.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM