如何在Android日历视图中为日期添加自定义颜色?

问题描述 投票:0回答:1

目前,我正在开发一个用于考勤管理系统的Andriod应用程序。用于通过使用红色和绿色区分用户,向用户显示他们在特定日期是“出席”还是“缺席”。我不知道该怎么做。

我尝试使用“zcustomcalendar”来实现该功能。但最终出现“无法解析:org.naishadhparmar.zcustomcalendar:zcustomcalendar:1.0.1”错误。

以下是我在项目中使用的依赖项。

dependencies {
    implementation 'androidx.appcompat:appcompat:1.5.0'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'org.naishadhparmar.zcustomcalendar:zcustomcalendar:1.0.1'
}
java android firebase android-layout user-interface
1个回答
0
投票

你必须添加

maven {
            url 'https://jitpack.io'
        }

在你的项目级别gradle中

© www.soinside.com 2019 - 2024. All rights reserved.