我正在试着做一个带有日历和一些其他东西的页面。我使用的是wix/react-native-calendars,我不能更改日历的高度。当我把高度放在上面的时候,我希望是这样,只要把日历剪短即可。
<CalendarList
horizontal={true}
pagingEnabled={true}
style={{height: SCREEN_HEIGHT * 0.4}}
/>发布于 2020-05-02 06:06:13
如果您希望完全控制日历样式,可以通过覆盖默认的style.js文件来实现。例如,如果你想首先覆盖样式,你必须找到这个文件的样式表id:
https://github.com/wix/react-native-calendars/blob/master/src/calendar/header/style.js#L4
在本例中,它是stylesheet.calendar.header。接下来,您可以使用此id将覆盖样式表添加到主题中。
https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendars.js#L56
theme={{
arrowColor: 'white',
'stylesheet.calendar.header': {
week: {
marginTop: 5,
flexDirection: 'row',
justifyContent: 'space-between'
}
}
}}https://stackoverflow.com/questions/61550938
复制相似问题