【发布时间】:2022-01-05 08:31:22
【问题描述】:
我将按钮设置为显示日历,当按下此按钮并选择显示在顶部日历条中的日期时。问题是样式仅针对预先选择的日期发生变化,当我选择新日期时,样式不起作用。
这是我的代码:
<CalendarStrip scrollable style={{ height: 70, paddingBottom: 10 }} calendarColor={'#4caf50'} selectedDate={new Date(date)} calendarHeaderStyle={{ display: "none" }} iconStyle={{ display: "none" }} highlightDateNameStyle={{ color: 'black', position: "absolute", bottom: 10, color: 'green', backgroundColor: "white" }} highlightDateNumberStyle={{ color: 'green', padding: 10, borderRadius: 6, backgroundColor: "white" }} dateNumberStyle={{ color: 'white', borderRadius: 6, }} dateNameStyle={{ color: 'white', position: "absolute", bottom: 0.5 }} iconContainer={{ flex: 0.1 }} /> {show && ( <DateTimePicker testID="dateTimePicker" value={new Date()} mode={mode} is24Hour={true} display="default" onChange={onChange} /> )}
【问题讨论】:
标签: javascript react-native styles