4

我正在尝试更改 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 似乎也缺少一个声明。我已经复制了 calendar_view.xmladt-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
4

0 回答 0