由网友(嗜血殇无痕)分享简介:你好我试图颜色我calendarview选择日期。我努力了字符串todayDate =(MDAY +/+ mMonth +/+ mYear); Toast.makeText(这一点,今天的日期+ todayDate,LENGTH_SHORT).show(); 光标光标= myDatabase.rawQuery...![Android 日历](https://p.xsw88.cn/allimgs/daicuo/20230907/4569.png)
你好我试图颜色我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);
这是,我使用改变我的颜色是什么。工程与按键,希望它为你工作了。
![Android 日历](https://p.xsw88.cn/allimgs/daicuo/20230907/4569.png)
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.
相关推荐
最新文章