水平滚动视图未显示所有图像React Native

时间:2016-08-05 10:31:47

标签: reactjs react-native redux

我有一个listView,我使用水平滚动视图来显示图库。有图库的前13行listView显示完全正常,但其余图像只是空白。只有占位符在那里。可能是什么原因。

  <View>
            <ScrollView
              style={styles.container}
              automaticallyAdjustInsets={false}
              horizontal={true}
              decelerationRate={0}
              snapToInterval={CARD_WIDTH + CARD_MARGIN*2}
              snapToAlignment="start"
              contentContainerStyle={styles.contentT}
              pagingEnabled={true}
              showsHorizontalScrollIndicator={false}
            >

            {_this.props.media.first_five_photos.map(function(photo) {
              return (<View style={[{width:width,  height: _this.props.media.height},styles.card]} key={photo.id}>
               <Text>
                 <Image
                 source={{uri: photo.image_url}}
                 style={{width:width,  height: _this.props.media.height}}/>
               </Text>
             </View>)
            })}

              </ScrollView>
              <View style={{position: "absolute",right: 15, top: (this.props.media.height/2)-20}}>
                <Text >
                  <Image style={{height: 30,width:30}} source={require("../assets/white-img-slide.png") }/>
                </Text>
              </View>
            </View>

1 个答案:

答案 0 :(得分:0)

Scrollview具有removeClippedSubviews属性。也许它会帮助你 https://facebook.github.io/react-native/docs/scrollview.html#removeclippedsubviews