yannecer / NCalendar

一款安卓日历,仿miui,钉钉,华为的日历,万年历、365、周日历,月日历,月视图、周视图滑动切换,农历,节气,Andriod Calendar , MIUI Calendar,小米日历
Apache License 2.0
1.59k stars 314 forks source link

How to change background color of calendar and today background. #60

Open kalaiarasi-p-4530 opened 4 years ago

kalaiarasi-p-4530 commented 4 years ago

I tried to change the background color of the calendar and today's background. app:calendarBackground="@color/red" // showing white bg app:todayCheckedBackground="@color/blue" // showing transparent bg

attached screenshot for reference

Screen Shot 2020-05-14 at 7 06 31 PM
yannecer commented 4 years ago

use shape resources like

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <solid android:color="@color/red" />
    <size
        android:width="40dp"
        android:height="40dp" />
</shape>

app:calendarBackground="@drawable/red"

kalaiarasi-p-4530 commented 4 years ago

Thank you !!! I have tried to change background color of calendar using drawable resource. It was working when a calendar is on month mode. When I scroll to week mode the background color not working. I have attached the screenshot below.

Screen Shot 2020-05-18 at 5 40 06 PM

Screenshot_1589803787 Screenshot_1589803790

yannecer commented 4 years ago

@kalaiarasisp I see your screenshot is the custom Adapter pattern,Custom property is invalid when in custom Adapter pattern ,You can try to change background color of calendar using drawable resource in "TestMiui10Activity"