Android 原生 CalendarView 修改样式

复制代码
<CalendarView
            android:id="@+id/calendar_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="10dp"
            app:layout_constraintTop_toBottomOf="@id/tv_title"
            android:theme="@style/CalendarViewStyle"
            android:weekDayTextAppearance="@style/weekDayTextStyle" />

在style中

复制代码
<!--星期的字体样式-->
    <style name="weekDayTextStyle" parent="TextAppearance.AppCompat">
        <item name="android:textColor">#F4F5F7</item>
        <item name="android:textSize">13sp</item>
    </style>

    <style name="CalendarViewStyle">
        <!--选中后背景-->
        <item name="colorAccent">#B9EBEC</item>
        <item name="colorPrimary">@color/white</item>
        <!--选中后字体颜色-->
        <item name="android:textColorPrimaryInverse">@color/color_333333</item>
        <!--标题颜色-->
        <item name="android:textColorPrimary">@color/white</item>
    </style>

参考链接 CalendarView 修改样式

相关推荐
爱勇宝7 小时前
我做了一个只用来搜歌词的小 App
android·前端·后端
众少成多积小致巨10 小时前
JNI (Java Native Interface) 技术手册中文参考指南
android·java·c++
Coffeeee17 小时前
如何使用Glide和Coil加载WebP动图
android·kotlin·glide
Kapaseker18 小时前
5 分钟搞懂 Kotlin DSL
android·kotlin
恋猫de小郭18 小时前
AI Agent 开发究竟是啥?如何用 AI 开发 Agent ?深入浅出给你一套概念
android·前端·ai编程
黄林晴18 小时前
Android 17 正式发布!target 37 一大批旧代码直接不能用了
android
Carson带你学Android19 小时前
Android 17 正式发布:AI 终于成了系统能力
android·前端·ai编程
三少爷的鞋19 小时前
当 UseCase 开始长期监听,它可能已经不是 UseCase 了
android
恋猫de小郭1 天前
Android 限制侧载新进展,谷歌联合国内厂商推验证计划
android·前端·flutter
恋猫de小郭1 天前
解读 Android 17 全新内存限制,有没有“豁免”后门?
android·前端·flutter