小编met*_*ite的帖子

react-native iOS应用程序在部署后不显示静态资产(图像)

我将所有静态图像放在项目根目录中名为"images"的文件夹中.但是,在我运行以下命令捆绑我的应用程序后,该应用程序可以正常工作,但没有显示图像.

我用来捆绑的命令:

./react-native bundle --minify --entry-file index.ios.js --platform ios --dev false --bundle-output main.jsbundle --assets-dest ./assets
Run Code Online (Sandbox Code Playgroud)

请注意,资源文件夹已创建,它包含我的图像文件夹,所有图像都可以.

你能帮帮忙吗?

deployment ios react-native

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

如何使用.fetch函数使API调用IPV6兼容react-native?

我开发了一个应用程序(用于IOS),用反应本机编写,在IPV4网络中运行良好.然而,最近Apple发送了一条消息,说我的应用程序在IPV6网络中测试时无效.他们告诉我,我必须使它与仅支持IPV6的网络兼容.

问题是,如何使我现有的API调用与IPV6网络兼容?

我的API使用https协议,它由域名调用,而不是原始IP.

我使用的示例获取调用是:

fetch(query,{
      method: 'post',
      headers: Utils.fetchHeaders('post')
      })
      .then(Utils.checkStatus)
      .then(Utils.parseJSON)
      .then(json => this._handleResponse(json))
      .catch(error => {

         this.setState({
          votingError: 'Sorry, there was an error!',
          loading: false
       });

      });
Run Code Online (Sandbox Code Playgroud)

API端点采用以下格式:

https://www.myapidomain.com

任何帮助赞赏.

ipv6 fetch ios react-native

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

React-native ListView不显示所有内容,在底部反弹(IOS)

这是我用来显示从ListView中的JSON Api返回的项目列表的代码.

render(){ var listHeight  = this.state.itemCount ? ((this.state.itemCount) * 115 ) : 0;
        var itemsHeight = 460;

        itemsListView = (<ListView bounces={true} style={{height: itemsHeight}} contentContainerStyle={{height: listHeight}}
            dataSource={this.state.dataSource}
            renderRow={this.renderRow.bind(this)} automaticallyAdjustContentInsets={false} initialListSize={4} />); }
Run Code Online (Sandbox Code Playgroud)

但是,ListView组件不允许我查看最后一个或两个项目.(当设备处于横向时,修剪更多内容)

renderRow方法返回高度为115的行,如下所示:

return (
<TouchableHighlight onPress={() => this.rowPressed(rowData)}
    style={{height: 115}}>...</TouchableHighlight>
Run Code Online (Sandbox Code Playgroud)

设置ListView样式和contentContainerStyle以在两个设备方向中显示所有行的正确方法是什么?

listview react-native

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

标签 统计

react-native ×3

ios ×2

deployment ×1

fetch ×1

ipv6 ×1

listview ×1