scrollView不要移到底部(带有屏幕截图)

时间:2018-12-12 17:05:04

标签: javascript reactjs react-native scroll scrollview

当我打开注释区域时,我要滚动ScrollView,直到最后一个注释文本。
'ScrollView'不会滚动到底部。
我试图将paddingBottom: 100添加到ScrollView中,但这无济于事

代码:

 return (
        <View>
          <View style={{ paddingBottom: 56 }}>
            <ScrollView style={{ backgroundColor: "#DEFEFC" }}>
              {commentsList.map(commentObj => {
                commNumber = commNumber + 1;
                return (
                  <View key={commentObj.CommentID} style={styles.separator}>
                    <Text style={{ paddingLeft: "5%" }}> {commNumber}. </Text>
                    <Text
                      style={{
                        paddingLeft: "5%",
                        textDecorationLine: "underline"
                      }}
                    >
                      {commentObj.Username}:
                    </Text>
                    <Text style={styles.commentContainer}>
                      {commentObj.Comment}
                    </Text>
                  </View>
                );
              })}
            </ScrollView>
          </View>
        </View>
      );

1)从下面的屏幕截图中可以看到,滚动视图不会滚动到底部。

2)在第二张图片上-当打开评论时,评论部分被进一步隐藏。 scrolled 'till end

打开评论后,视图会更加隐藏 scrolled 'till end

0 个答案:

没有答案