【发布时间】:2021-09-24 17:07:55
【问题描述】:
我有一个用例,我必须在每个日期渲染一张图像。最初,我在考虑react-native-calendar,但找不到任何有用的东西。在这里,我将附上我想要实现的屏幕截图。
【问题讨论】:
标签: react-native react-native-calendars
我有一个用例,我必须在每个日期渲染一张图像。最初,我在考虑react-native-calendar,但找不到任何有用的东西。在这里,我将附上我想要实现的屏幕截图。
【问题讨论】:
标签: react-native react-native-calendars
根据文档,您可以使用 dayComponent 属性覆盖 component。
<Calendar
style={[styles.calendar, {height: 300}]}
dayComponent={({date, state}) => {
return (
<View>
<Text style={{textAlign: 'center', color: state === 'disabled' ? 'gray' : 'black'}}>
{date.day}
</Text>
</View>
);
}}
/>
【讨论】: