我正在尝试使用 React Native Calendar 将议程实施到我的应用程序中。渲染标记日期时如何更改这些项目的颜色?
以下是我这部分的代码:
<Agenda
testID={CONSTANTS.AGENDA.CONTAINER}
items={events}
selected={Utils.formatDate(Date.now())}
renderItem={renderItem}
renderEmptyDate={renderEmptyDate}
renderEmptyData={renderEmptyData}
rowHasChanged={rowHasChanged}
showClosingKnob={true}
pastScrollRange={15}
futureScrollRange={15}
onDayChange={(day) => {
console.log("day changed");
}}
onDayPress={(day) => {
setDate(new Date(day.dateString));
}}
theme={{
selectedDayBackgroundColor: CONSTANTS.STYLES.COLORS.PRIMARY,
dotColor: CONSTANTS.STYLES.COLORS.PRIMARY,
selectedDotColor: "#ffffff",
todayTextColor: CONSTANTS.STYLES.COLORS.PRIMARY,
monthTextColor: CONSTANTS.STYLES.COLORS.PRIMARY,
}}
/>
const renderItem = (item) => (
<TouchableRipple
testID={CONSTANTS.AGENDA.ITEM}
style={[styles.item, { height: item.height || "auto" }]}
onPress={() => Alert.alert(item.name)}
>
<Text>{item.name}</Text>
</TouchableRipple>
);
太感谢了!!!!!