Javascript ScrollView子布局必须通过contentContainerStyle属性应用

Javascript ScrollView子布局必须通过contentContainerStyle属性应用,javascript,reactjs,react-native,react-native-android,react-native-ios,Javascript,Reactjs,React Native,React Native Android,React Native Ios,我使用的是react native swiper。这个错误被证明了,我不知道为什么。怎么解决呢??过去没有这样的问题。这是第一次发生。怎么了 以下是完整错误的图像: <Swiper loop={false} index={0} style={styles.wrapper} activeDotColor={'#EEE'}> <View style={styles.slide1}>

我使用的是react native swiper。这个错误被证明了,我不知道为什么。怎么解决呢??过去没有这样的问题。这是第一次发生。怎么了

以下是完整错误的图像:

<Swiper loop={false}
          index={0}
          style={styles.wrapper}
          activeDotColor={'#EEE'}>

          <View style={styles.slide1}>
            <Text style={styles.text}>Choose category you like</Text>
          </View>
          <View style={styles.slide2}>
            <Text style={styles.text}>Bookmark articles that you</Text>
            <Text style={styles.text}>like</Text>
          </View>
          <View style={styles.slide3}>
            <Text style={styles.text}>Get notifications about your</Text>
            <Text style={styles.text}>chosen topic</Text>
            <Button style={styles.text} onPress={() => this.props.navigation.navigate("Home")}>
              <Text style={styles.text}>Main Screen</Text>
            </Button>
          </View>
        </Swiper>
      )
    } else {
      return <View></View>
    }
  }
}

const styles = {
  wrapper: {
    justifyContent: 'center',
    alignItems: 'center'
  },
  slide1: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#9DD6EB'
  },
  slide2: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#97CAE5'
  },
  slide3: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#92BBD9'
  },
  text: {
    alignSelf: 'center',
    color: '#FFF',
    fontSize: 26,
    fontWeight: 'bold'
  },
}

export default WelcomeScreen


选择你喜欢的类别
将你喜欢的文章加入书签
喜欢
获取有关您的应用程序的通知
选题
this.props.navigation.navigate(“Home”)}>
主屏幕
)
}否则{
返回
}
}
}
常量样式={
包装器:{
为内容辩护:“中心”,
对齐项目:“中心”
},
幻灯片1:{
弹性:1,
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#9DD6EB”
},
幻灯片2:{
弹性:1,
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#97CAE5”
},
幻灯片3:{
弹性:1,
为内容辩护:“中心”,
对齐项目:“居中”,
背景颜色:“#92BBD9”
},
正文:{
对齐自我:“中心”,
颜色:“#FFF”,
尺寸:26,
fontWeight:“粗体”
},
}
导出默认Welcome屏幕
请帮助解决这个烦人的问题。

添加这样的样式

<Swiper loop={false}
          index={0}
          contentContainerStyle={styles.wrapper}
          activeDotColor={'#EEE'}>

使用
contentContainerStyle
道具,而不是
style
道具

contentContainerStyle={styles.wrapper}