小编chc*_*chc的帖子

可能未处理的承诺拒绝(id 0)类型错误 GET 或 HEAD 请求不允许主体

import React from 'react';
import { FlatList, ActivityIndicator, Text, View  } from 'react-native';

export default class FetchExample extends React.Component {

  constructor(props){
    super(props);
    this.state ={ isLoading: true}
  }

  componentDidMount(){

        fetch('https://apitest.kuveytturk.com.tr/prep/v1/data/fecs', {
             method: 'GET',
             headers: {
               Accept: 'application/json',
               'Content-Type': 'application/json',
             },
             body: JSON.stringify({
               firstParam: 'isoCode ',
               secondParam: 'internationalCode',
               thirdParam: 'name',
               fourthParam: 'code',
               FifthParam: 'group',
               SixthParam: 'id'
             }),
           });

}


  render(){

    if(this.state.isLoading){
      return(
        <View style={{flex: 1, padding: 20}}>
          <ActivityIndicator/>
        </View>
      )
    }

    return(
      <View style={{flex: 1, paddingTop:20}}>
        <FlatList
          data={this.state.dataSource}
          renderItem={({item}) => <Text>{item.isoCode}, {item.internationalCode}, …
Run Code Online (Sandbox Code Playgroud)

javascript android react-native

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

如何将@2x @3x 图像集成到 React Native 项目(Android 和 IOS)?

我已将相同图像的版本 (@2x @3x) 添加到 src>assets 以在所有设备上运行我们的平台。问题来了,VSCode 只识别 ie path.png(它不识别 @2x 和 @3x)。我们如何处理这个问题?

android resolution image reactjs react-native

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

标签 统计

android ×2

react-native ×2

image ×1

javascript ×1

reactjs ×1

resolution ×1