小编Jam*_*mes的帖子

React-Native Rendering json flatlist

我是本机反应的新手。我正在建立复杂性,但一直坚持从 json 列表呈现 FlatList 项目。这对于 ListView 工作正常,但无法弄清楚我在 FlatList 上缺少什么。

import React, { Component } from 'react';
import { ActivityIndicator, ListView, Text, View, StyleSheet,TouchableOpacity, FlatList  } from 'react-native';

export default class Movies extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isLoading: true
    }
  }

  componentDidMount() {
    return fetch('https://gnosisdevelopment.com/office/list.json')
      .then((response) => response.json())
      .then((responseJson) => {
        let data_source = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
        this.setState({
          isLoading: false,
          dataSource: data_source.cloneWithRows(responseJson.office_staff),
        }, function() {
          // do something with new state
        }); …
Run Code Online (Sandbox Code Playgroud)

json react-native react-native-flatlist

5
推荐指数
1
解决办法
1万
查看次数

带#in宏名称的C#define语句

是否有可能以某种方式声明这样的#define语句?

    #define #Name# struct->name
Run Code Online (Sandbox Code Playgroud)

我收到错误"错误:宏名称必须是标识符",我知道这与#符号有关.是否有允许#符号的解决方法?

macros c-preprocessor

1
推荐指数
1
解决办法
3023
查看次数