reactjs - 按下时如何更改选定的日期背景颜色
问题描述
我尝试过使用 selectedDayBackgroundColor。但它不起作用。当按下 selDate 时,背景颜色应该会改变。
<Calendar style={{
borderRadius: 20,
height: 370,
marginTop: -1,
width: 350,
borderTopLeftRadius: 0,
borderTopRightRadius: 0
}} enableSwipeMonths={true}
onDayPress={(date) => {
(date)
const currentDate = Moment(date.dateString).add(1, "days").toISOString();
dispatch(getEvents(currentDate));
dispatch(getOnLeaveDeveloper(currentDate))
setCurrentDateToday(currentDate);
// @ts-ignore
setSelDate(currentDate);
console.log(selDate);
}
}
theme={{
todayTextColor: "#FFFFFF",
monthTextColor: "#FFFFFF",
textColor: "#FFFFFF",
arrowColor: "#FFFFFF",
dayTextColor: "white",
calendarBackground: "#171717",
textDayFontSize: 10,
}}
/>
解决方案
推荐阅读
- android - Gradle 错误显示“无法解析配置 ':app:debugRuntimeClasspath' 的所有文件。”
- sql - SQL:用反斜杠转义
- python - 使用自动操作,使用另一个字段的值(在销售订单上)更新字段的值(在交货单上)
- c# - 异步方法在控制台应用程序中无法正常工作
- reactjs - 在子组件中使用状态设置器功能
- json - 如何在同一功能中从 JSON 和 CSV 读取测试数据
- python - 如何计算每行python中的每个单词
- python - django-admin runserver 错误(DJANGO_SETTINGS_MODULE 未设置)
- gurobi - Gurobi 的最优解违反约束 0.29%
- json - JSON到Excel的转换,通过使用go lang map数据结构每次都不会产生相同的输出