这是react-native-calendars
. 它无法正确呈现子组件(日期),或者只是在ReactNative.I18nManager.allowRTL(true);
.
目前,临时解决方案是将 flex-direction 更改为row-reverse
并以相反方向渲染箭头:
<Calendar theme={'stylesheet.calendar.main': {
week: {
marginTop: 7,
marginBottom: 7,
flexDirection: isRTL ? 'row-reverse' : 'row',
justifyContent: 'space-around'
}
},
'stylesheet.calendar.header': {
header: {
flexDirection: isRTL ? 'row-reverse' : 'row',
justifyContent: 'space-between',
paddingLeft: 10,
paddingRight: 10,
alignItems: 'center',
height: 45
},
week: {
marginTop: 7,
flexDirection: isRTL ? 'row-reverse' : 'row',
justifyContent: 'space-around'
}}
}}
renderArrow={direction => <Icon type="ionicon"
name={direction === 'left'
? (isRTL ? 'arrow-forward' : 'arrow-back')
: (isRTL ? 'arrow-back' : 'arrow-forward')}
/>}
/>