Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 屏幕中间的平面列表不显示';我不能展示全部内容_Javascript_React Native_React Native Flatlist - Fatal编程技术网

Javascript 屏幕中间的平面列表不显示';我不能展示全部内容

Javascript 屏幕中间的平面列表不显示';我不能展示全部内容,javascript,react-native,react-native-flatlist,Javascript,React Native,React Native Flatlist,正如我上面所说,我的问题是,我的平面列表位于屏幕的中间,并进入底部,没有显示我最后一张卡的全部内容。像这样: 正如你所看到的,最后一张卡片缺少图像和3个动作按钮,你可以看到上面的卡片。所以我的问题是我能给平面列表什么风格,或者它是否有解决这个问题的属性。 提前谢谢你的帮助 编辑 这是我的代码(我认为是相关部分): 在滚动视图中包装整个视图。我想这应该行得通我们需要一些代码来帮助您,很难看出这里有什么问题。谢谢。我更新了我的问题@Arnaud如果你的问题来自于样式错误,我们需要你当前的样式我添加

正如我上面所说,我的问题是,我的平面列表位于屏幕的中间,并进入底部,没有显示我最后一张卡的全部内容。像这样:

正如你所看到的,最后一张卡片缺少图像和3个动作按钮,你可以看到上面的卡片。所以我的问题是我能给平面列表什么风格,或者它是否有解决这个问题的属性。 提前谢谢你的帮助

编辑 这是我的代码(我认为是相关部分):


在滚动视图中包装整个视图。我想这应该行得通

我们需要一些代码来帮助您,很难看出这里有什么问题。谢谢。我更新了我的问题@Arnaud如果你的问题来自于样式错误,我们需要你当前的样式我添加了标记和样式@Arnaud请尝试包含一个链接,以复制类似expo maybe的问题。使帮助变得更容易。
return (
    <View>
      <View style={styles.topHeader}>
        <View style={styles.imageProfile}>

          {this.state.isLoaded ?
            this.props.isLogged ?
              <View>
                <View style={styles.imgContainer} style={{ alignItems: "center", marginBottom: 20 }}>
                  <Image style={styles.userImg} style={{ width: 100, height: 100, borderRadius: 50 }} source={{ uri: "data:image/png;base64," + this.state.user.picture }} />
                </View>
                <Text style={styles.name}>{this.state.user.name}</Text>
                <Text style={styles.subheaderText}>{arrayCounters}</Text>
              </View>
              :
              <View>
                <View style={styles.imgContainer} style={{ alignItems: "center", marginBottom: 20 }}>
                  <Image style={styles.userImg} style={{ width: 100, height: 100, borderRadius: 50 }} source={require("../../assets/no-user.jpg")} />
                </View>
                <TouchableOpacity onPress={this.logIn}>
                  <Text style={styles.subheaderText}>Iniciar sesión</Text>
                </TouchableOpacity>
              </View>
            : null}

          {!this.state.isLoaded &&
            <View style={styles.loading}>
              <ActivityIndicator size="large" color="#F5DA49" />
            </View>
          }
        </View>
      </View>
      <View style={styles.tabsContainer}>
        <TouchableOpacity onPress={() => this.changeTab(1)} style={[styles.tab, this.state.tabSelected === 1 && styles.tabSelected]}>
          <Text style={styles.tabText}>PÚBLICACIONES</Text>
        </TouchableOpacity>
        <TouchableOpacity onPress={() => this.changeTab(2)} style={[styles.tab, this.state.tabSelected === 2 && styles.tabSelected]}>
          <Text style={styles.tabText}>FAVORITOS</Text>
        </TouchableOpacity>
      </View>

      <View>


 <View>
{this.state.isLoadedMyPosts && this.state.tabSelected === 2 && 
 this.state.favoritesPosts &&
            <FlatList
              data={this.state.favoritesPosts}
              renderItem={({ item, separators }) => (
                <PostItem key={item._id} item={item} isTabFavorites= 
                 {true} removedFav={this.removedFav.bind(this)} />

              )}
              keyExtractor={item => item._id}
              onEndReachedThreshold={0.5}
            />
        }
const styles = StyleSheet.create({
  noPosts: {
    alignItems: 'center',
    position: "relative",
    marginTop: 50
  },
  textNoPosts: {
    marginTop: 20,
    fontSize: 20
  },
  name: {
    fontSize: 18,
    color: "#FFF",
    marginBottom: 5
  },
  tabText: {
    color: "#262628",
    fontSize: 20
  },
  tabsContainer: {
    width: width,
    flexDirection: "row",
    marginBottom: 10
  },
  tab: {
    width: width / 2,
    backgroundColor: "#FFF",
    alignItems: "center",
    paddingVertical: 15
  },
  tabSelected: {
    borderBottomColor: '#F5DA49',
    borderBottomWidth: 4
  },
  loadingPosts: {
    position: 'absolute',
    left: 0,
    right: 0,
    top: 120,
    justifyContent: 'center',
    alignItems: 'center'
  },
  loading: {
    position: 'absolute',
    left: 0,
    right: 0,
    top: 0,
    bottom: 0,
    opacity: 0.5,
    backgroundColor: 'black',
    justifyContent: 'center',
    alignItems: 'center'
  },
  topHeader: {
    backgroundColor: "#262628",
    width: width,
    height: 200
  },
  imageProfile: {
    justifyContent: "center",
    alignItems: "center",
    height: 200
  },
  userImg: {
    borderRadius: 50,
    alignItems: "center"
  },
  subheaderText: {
    color: "#fff"
  },
  imgContainer: {

  }
});