首页 > 解决方案 > 无法在平面列表中呈现功能图标 - React Native

问题描述

图标没有出现。警报正在工作。无法在平面列表中呈现功能图标。请帮忙。我需要你的帮助。

我的代码:

<FlatList
    data={this.state.data}
    //extraData={}
    keyExtractor={(item, index) => {
      return index.toString();
    }}
    renderItem={({ item }) =>
      <View style={styles.cartView}>
        <TouchableOpacity style={styles.touchView} onPress={() => Linking.openURL(item.app_link)}>
          <Image style={styles.cartLogo} source={{ uri: item.app_resim }} />
        </TouchableOpacity>
        <Text style={styles.mainViewText}>{item.app_name}</Text>
        <View style={styles.mainViewAltBar}>
          <TouchableOpacity >
            <Icon name="refresh-outline" size={30} color="#404040" />
          </TouchableOpacity>
          {this.appSet(item.app_namep)}
        </View>
      </View>
    } />

appSet(value){
AppInstalledChecker.isAppInstalledAndroid(value)
.then((isInstalled) => {//not show icons but alert working
  if (isInstalled) {
    return (<Icon name="checkmark-outline" size={30} color="#404040" />);
  } else {
    return (<Icon name="close-outline" size={30} color="#404040" />);
    //alert(isInstalled);
  }
})

}

谢谢你。

标签: reactjsreact-nativereact-native-flatlist

解决方案


推荐阅读