小编unk*_*123的帖子

反应原生的最佳文件选择器

我试过__CODE__等等但是没有一个在哪里工作正常.任何人都可以建议我__CODE__从设备存储中选择文件.

react-native react-native-android react-native-ios

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

将Json响应加载到本机响应中的下拉列表中

我在我的应用程序中使用了材料下拉列表

<Dropdown 
  baseColor='white'
  itemColor='white'
  label='Select Cluster'
/>
Run Code Online (Sandbox Code Playgroud)

我像这样获取JSON对象,它工作正常.

  fetch('url', {  
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      username : "admin"
    })
  }).then((response) => response.json())
  .then((responseJson) => {
    var count = Object.keys(responseJson.message.Obj).length;
    for(var i=0;i<count;i++){
      console.log(responseJson.message.Obj[i].name) // I need to add 
      //these names to dropdown
    }
  })
  .catch((error) => {
    console.error(error);
  });
Run Code Online (Sandbox Code Playgroud)

现在我需要将responseJson.message.Obj[i].name值添加到我的下拉列表中.

javascript react-native react-native-android react-native-ios

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