6

Tôi đang sử dụng trình quét gốc phản ứng. và lỗi này được hiển thị tôi không biết tại sao. Làm thế nào nó có thể được giải quyết? Trong quá khứ, không có vấn đề gì như thế này cả. Đây là lần đầu tiên xảy ra. Chuyện gì thế?Bố cục con ScrollView phải được áp dụng thông qua contentContainerStyle prop

Dưới đây là hình ảnh của một lỗi đầy đủ:

Here is the image of a full error

<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 

Xin giúp để giải quyết rắc rối này gây phiền nhiễu.

Trả lời

3

Thêm kiểu như thế này

<Swiper loop={false} 
      index={0} 
      contentContainerStyle={styles.wrapper} 
      activeDotColor={'#EEE'}> 
Các vấn đề liên quan