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

相关推荐
雨白12 小时前
单例设计模式:从 Java/Kotlin 实现到 Android 实战
android
hai_android17 小时前
一行 asLiveData,背后是一座生命周期的桥
android·java·kotlin
阿杰m18 小时前
Android源码第二十三章:Telephony、RIL 与 IMS——来电怎么到应用?
android
booboosui18 小时前
没人认领 .md:安卓把报告交给了音乐播放器打开
android
用户607097591490620 小时前
AOSP 14 OTA 升级指导(四):update_engine 内部机制——Action 流水线与写盘
android
恋猫de小郭1 天前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
JMchen1231 天前
【Android 性能优化实战 60 讲】12 异步 Inflate 实战与痛击:源码拆解原生瓶颈,手写增强版布局预加载框架
android·性能优化·实战·启动优化·异步inflate·x2c
好的佩奇1 天前
蓝牙之设备角色与连接
android·flutter·蓝牙
雨白2 天前
Android 消息机制剖析:从 Handler 投递到 Looper 循环的全链路
android
GY-932 天前
【Android】数据分层和依赖注入
android