【问题标题】:React Native Timeline listview is not renderingReact Native Timeline 列表视图未呈现
【发布时间】:2023-04-03 02:19:01
【问题描述】:

我在我的 ract-native 页面(库 ract-native-timeline-listview)中使用了 Basic Usage 时间线列表视图。它适用于其默认数据。 但是当我通过componentWillMount() 包含数据时

componentWillMount() {
    var list = CustomerStore.usagelist;
    this.setState({data:list});
    console.log(JSON.stringify(list));
}

日志在运行 render() 之前打印数据,但列表视图没有显示,而是引发警告

警告:在下一个版本中,将呈现空的节标题。在此版本中,您可以使用“enableEmptySections”标志来呈现空的节标题。

flag我也用过,但是没用。

<Timeline data={this.state.data} enableEmptySections={true} />

有人对此有解决方案吗?

我正在使用 React-Native :0.38

Link to the library

【问题讨论】:

  • 包括渲染函数(即renderEvent、renderDetail、renderCircle、renderTime等)
  • 谢谢。我已经通过 react-native-timeline-listview 中的 Pull Refresh 类型的列表视图解决了这个问题。

标签: listview react-native timeline


【解决方案1】:

如果你还在寻找这个,
它变成了 npm i react-native-timeline-flatlist

只需将 flex:1 赋予包含的 View 或 height:"100%"

<View style={{height:"100%"}}> 
  //TimelineListView is a separate component i made
   <TimelineListView>
 </View>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-10
    • 2022-12-15
    • 2016-11-08
    • 2022-01-10
    • 2017-11-11
    • 1970-01-01
    相关资源
    最近更新 更多