首页 > 解决方案 > React Native 中的倒计时(显示分钟和秒的顺序)

问题描述

我正在使用 react-native-countdown-component。我的代码是:

<CountDown
             timeToShow={['M', 'S']}
             timeLabels={{ m: '', s: '' }}
             digitStyle={{ backgroundColor: 'transparent' }}
              showSeparator={true}
             until={this.state.until}
              size={moderateScale(20)}
           />

我的问题是它先显示秒,然后显示分钟!!!(从左到右)没有任何样式。为什么?????!!!

在此处输入图像描述

标签: react-native-androidcountdown

解决方案


没有父元素。我的代码只是:

const App: () => React$Node = () => {
 render() { 
 return ( 
 <CountDown 
 timeToShow={['M', 'S']} 
  timeLabels={{ m: '', s: '' }} 
 digitStyle={{ backgroundColor: 'transparent' }} 
 showSeparator={true} until={this.state.until} 
 size={moderateScale(20)} /> 
  ) 
 }

}

但输出是:在此处输入图像描述

虽然必须显示第一分钟,然后是第二分钟!!!(从左到右)


推荐阅读