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 修改样式

相关推荐
墨狂之逸才16 小时前
Android TV WebView 遥控器按键处理:从全透传到白名单
android
plainGeekDev1 天前
MVC 写法 → MVVM
android·java·kotlin
恋猫de小郭1 天前
Flutter Patchwork,不用 Fork 改依赖包源码的第三方工具
android·前端·flutter
三少爷的鞋1 天前
“结构化”这个词,本质上就是——把混乱的东西变成有组织、有规则、有边界的东西
android
方白羽2 天前
Android Gradle 缓存与文件目录深度解析
android·gradle·android studio
曲幽2 天前
Termux里的二进制和脚本,到底怎么运行才不踩坑?Termux-service 保活妙招!
android·termux·nohup·services·wake-lock
plainGeekDev2 天前
单例模式 → object 声明
android·java·kotlin
程序员陆业聪2 天前
读者点单·03|Compose 与传统 View 混用的 12 个真实坑
android
程序员陆业聪2 天前
读者点单·02|Android 启动优化实战:Trace 抓取→Application 编排→冷启动全流程拆解
android
Coffeeee2 天前
帮你快速理解AI Agent之我想招个Android实习生
android·人工智能·agent