我正在尝试更改Android的CalendarView中特定日期的文字颜色,以标记有活动的日期。
我目前正在尝试通过复制Android的CalendarView.java并在相关位置注入我自己的代码来实现这一目标,但我愿意接受其他解决方案。
到目前为止,我已将源CalendarView.java文件从adt-bundle-windows-x86\sdk\sources\android-14\android\widget
复制到我的项目中,并且我试图让它在我的项目中工作,但是R.styleable存在很多问题,例如
TypedArray attributesArray = context.obtainStyledAttributes(attrs, R.styleable.CalendarView,
R.attr.calendarViewStyle, 0);
mShowWeekNumber = attributesArray.getBoolean(R.styleable.CalendarView_showWeekNumber,
DEFAULT_SHOW_WEEK_NUMBER);
mContext似乎也缺少一个声明。我已经从adt-bundle-windows-x86\sdk\platforms\android-15\data\res\layout
以下是出现的错误:
Description Resource Path Location Type
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 369 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 368 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 374 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 371 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 362 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 359 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 366 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 364 Java Problem
calendar_view cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 400 Java Problem
mContext cannot be resolved CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 398 Java Problem
mContext cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 1095 Java Problem
com.android.internal.R cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 404 Java Problem
list cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 403 Java Problem
mContext cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 739 Java Problem
com.android.internal.R cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 376 Java Problem
TextAppearance_Small cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 374 Java Problem
com.android.internal.R cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 405 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 382 Java Problem
mContext cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 1035 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 378 Java Problem
mContext cannot be resolved to a variable CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 1034 Java Problem
error: Error: Resource is not public. (at 'id' with value '@+android:id/month_name'). calendar_view.xml /LoginActivity/res/layout line 25 Android AAPT Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 346 Java Problem
LocaleData cannot be resolved CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 347 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 348 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 352 Java Problem
error: Error: Resource is not public. (at 'id' with value '@+android:id/day_names'). calendar_view.xml /LoginActivity/res/layout line 33 Android AAPT Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 342 Java Problem
calendarViewStyle cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 343 Java Problem
styleable cannot be resolved or is not a field CalendarView.java /LoginActivity/src/uk/ac/bris/newtouch/newplan line 344 Java Problem