React Native 中文网 使用导航器跳转页面代码中错误整理

ios端运行时出现下面错误。

1.Clear watchman watches: `watchman watch-del-all`.

2.Delete the `node_modules`folder: `rm -rf node_modules && npm install`.

3.Reset packager cache: `rm -fr $TMPDIR/react-*`or `npm start -- --reset-cache`.


推测是node_modeules 中缺少prop-types组件导致

执行下面命令:

npm install prop-types

然后按上面提示的3个命令重新执行一边,解决该问题。

然后出现AppRegistry问题

在到入组件的代码中加入:AppRegistry

然后注册组件:AppRegistry.registerComponent('AwesomeProject',()=>AwesomeProject);

解决AppRegistry问题。

看不见按钮title问题。

因为加了navgationbar,view从0开始。被挡到了。加上

<View style ={{flex:1,top:64,backgroundColor:'powderblue'}}>就行了。

ios navigationbar高度为64. 

ios可以设置从navigationbar下面开始算坐标。rn上暂时没找到怎么设置。后面再找找

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值