添加事件CalendarView [英] Add event to CalendarView

查看:815
本文介绍了添加事件CalendarView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得这个问题说明了一切:是否有可能显示在Android违约事件 CalendarView

I think the question says it all: is it possible to display events in the Android default CalendarView?

我知道,它是由用于小部件,而不是一个真正的日历应用程序,但我的应用程序不应该是一个日历应用程序。这是我的应用程序只有一点点功能,所以我想查看是适合我的要求。我只是无法查看它的活动,否则它是完美的我。

I know that it is made for widgets and not for a real Calendar application but my app should not be a Calendar application. It is only a little feature in my app so I think the View is perfect for my claims. I only can't view events in it, otherwise it is perfect for me.

我读这回答并试图覆盖从 CalenderView

@Override
protected void onDraw(Canvas canvas)
{
    p = new Paint();

    p.setColor(Color.RED);
    p.setStrokeWidth(10);

    super.onDraw(canvas);
    canvas.drawRect(0, 0, 100, 100, p);
}

但即便如此code不工作,不显示矩形。其他4种方法是私人,所以我不能覆盖它们。任何其他的想法如何,我可以解决这个问题?我不想使用图书馆,但如果有我要找的东西,什么是真正接近股票 CalendarView 没有别的办法。或者,也许我可以创建只在我的应用程序,而不是显示在其他日历应用程序的日历文件?

But even this code does not work and no rectangle is displayed. The other 4 methods are private so I can't overwrite them. Any other ideas how I can solve this problem? I do not want to use a library, but if there is no other way I'm looking for something what is really near to the stock CalendarView. Or maybe I can create a calendar file which is only visible in my app and not in other calendar apps?

推荐答案

您不能添加在违约事件 CalendarView 。要么你需要使它的自定义或者你需要使用一些库。

You can't add events in default CalendarView. either you need to make it custom or you need to use some library.

我已经使用 Caldroid 库许多times.it很容易实现和鲁棒性。

I have used Caldroid library many times.it is easy to implement and robust.

这篇关于添加事件CalendarView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆