[英]react-native-calendars ExpandableCalendar not worknig propely with RTL in react native
I'm trying to use ExpandableCalendar from https://github.com/wix/react-native-calendars我正在尝试使用https://github.com/wix/react-native-calendars中的 ExpandableCalendar
my App set to RTL ReactNative.I18nManager.allowRTL(true); ReactNative.I18nManager.forceRTL(true);
我的应用程序设置为 RTL
ReactNative.I18nManager.allowRTL(true); ReactNative.I18nManager.forceRTL(true);
ReactNative.I18nManager.allowRTL(true); ReactNative.I18nManager.forceRTL(true);
when the calendar is expanded and I'm trying to change the month it doesn't show new dates of next month or prev month, it's just showing name of the month that different from the header month.当日历展开并且我试图更改月份时,它不会显示下个月或上个月的新日期,它只是显示与 header 月份不同的月份名称。
however setting RTL to false fixes the problem.但是将 RTL 设置为 false 可以解决问题。 is there some solution without setting RTL to false?
有没有将 RTL 设置为 false 的解决方案?
image after changing month by swiping right/left or by clicking on arrows to change month:通过向右/向左滑动或单击箭头更改月份来更改月份后的图像:
This is a known issue with react-native-calendars
.这是
react-native-calendars
的一个已知问题。 It is not able to render the child components (the dates) properly or is just ignoring it when ReactNative.I18nManager.allowRTL(true);
它无法正确呈现子组件(日期),或者在
ReactNative.I18nManager.allowRTL(true);
时忽略它. .
For now, the temporary solution is to change the flex-direction to row-reverse
and rendering the arrows in the opposite direction:目前,临时解决方案是将 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')}
/>}
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.