变色的日历日期的android [英] change color of calendar dates android

查看:715
本文介绍了变色的日历日期的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我试图颜色我calendarview选择日期。
我努力了
字符串todayDate =(MDAY +/+ mMonth +/+ mYear);

  Toast.makeText(这一点,今天的日期+ todayDate,LENGTH_SHORT).show();    光标光标= myDatabase.rawQuery(SELECT * FROM+ Calms.DATABASE_FLARE_TABLE,NULL);    //calendarView.setDateTextAppearance(Integer.parseInt(\"@+color/orange));    对于(诠释计数= 1;计数< = cursor.getCount();计数++)
    {
        cursor.moveToNext();
        串savedDate = cursor.getString(2);        //calendarView.setDateTextAppearance(getResources().getColor(R.color.orange));
        //calendarView.setDateTextAppearance(R.color.color);        Toast.makeText(这一点,日期DB:+ savedDate,LENGTH_SHORT).show();
        Toast.makeText(这一点,下一步,LENGTH_SHORT).show();        如果(savedDate.equals(todayDate))
        {
            Toast.makeText(这一点,IN IF !!,LENGTH_SHORT).show();
            //calendarView.setDateTextAppearance(Integer.parseInt(\"@color/orange));            calendarView.setDateTextAppearance(getResources()的getColor(R.color.orange));
        }

我也尝试context.getRes .....

似乎没有任何工作。日期的颜色不会改变。

会有人能够帮助?
谢谢


解决方案

  setTextColor(Color.GREEN);

这是,我使用改变我的颜色是什么。工程与按键,希望它为你工作了。

Hi I am trying to color the date selected in my calendarview. I have tried String todayDate = (mDay+"/"+mMonth+"/"+mYear);

    Toast.makeText(this, "TODAYS DATE" + todayDate, LENGTH_SHORT).show();

    Cursor cursor = myDatabase.rawQuery("select * from " + Calms.DATABASE_FLARE_TABLE, null);

    //calendarView.setDateTextAppearance(Integer.parseInt("@+color/orange"));

    for(int count=1; count<=cursor.getCount(); count++)
    {
        cursor.moveToNext();
        String savedDate = cursor.getString(2);

        //calendarView.setDateTextAppearance(getResources().getColor(R.color.orange));
        //calendarView.setDateTextAppearance(R.color.color);

        Toast.makeText(this, "DATE IN DB: "+ savedDate, LENGTH_SHORT).show();
        Toast.makeText(this, "next", LENGTH_SHORT).show();

        if (savedDate.equals(todayDate))
        {
            Toast.makeText(this, "IN IF!!", LENGTH_SHORT).show();
            //calendarView.setDateTextAppearance(Integer.parseInt("@color/orange"));

            calendarView.setDateTextAppearance(getResources().getColor(R.color.orange));
        }

I have also tried context.getRes.....

Nothing seems to work. The colour of the date never changes.

Would anyone be able to help? Thanks

解决方案

setTextColor(Color.GREEN);

this is, what i am using to change my colors. Works with buttons, hope it works for you, too.

这篇关于变色的日历日期的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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