react-native 问题总结
来源:互联网 发布:化工常用绘图软件 编辑:程序博客网 时间:2024/05/02 11:19
1、导航
Q:在使用Navigator的同时使用ListView或ScrollView,后两者的头部会多出一些空间。
A:将automaticallyAdjustContentInsets属性设为{false}.
2、子组件
Q:报错:Invariant Violation: onlyChild must be passed a children with exactly one child
A:一般是Touchable开头的几个组件,如果没有子元素或者指定多个并列子元素都会报错。
3、风格混用
Q:报错:Invariant Violation: Element type is invalid
A:如果是引入新组件时报的错,据@tdzl2003 解释:
从ReactNative 0.16起,babel升级到了6.x版本。
在babel6中,require和export default不能直接配对使用。
所以,你要么把
var Hello = require(‘./components/Hello’);
改为
import Hello from ‘./components’
要么把
export default React.createClass({
改为
module.exports = React.createClass({
二者选其一,配对使用。
4、组件查找
Q:如何读写文件?如何调用摄像头?如何调用麦克风?等等
A:对于官方没有提供的组件或API,请自行在js.coach或github中搜索第三方实现。如果搜不到相关结果,你只能考虑自己用原生代码实现后整合进来。
5、常见问题
http://bbs.reactnative.cn/topic/130/%E6%96%B0%E6%89%8B%E6%8F%90%E9%97%AE%E5%89%8D%E5%85%88%E6%9D%A5%E8%BF%99%E9%87%8C%E7%9C%8B%E7%9C%8B-react-native%E7%9A%84%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
6、修改工程包名
https://segmentfault.com/q/1010000005609103
- react-native 问题总结
- React Native问题总结
- React native 问题总结
- React-native 遇到问题总结
- react-native 问题收集总结
- React Native 学习之问题总结
- react native 遇到的问题总结
- react-native之Androidstudio安装问题总结
- React-Native开发总结-react层面上的问题
- React Native 学习总结
- React Native Image 总结
- React-Native 常见问题总结
- React Native开发总结
- React-Native学习总结
- React Native总结
- react native遇到问题
- react-native问题
- React Native 问题小结
- 树状数组
- 8天学通MongoDB——第四天 索引操作
- 【安卓系统源码学习之在线阅读】Android程序员必备本领--查看系统源代码
- wireshark包过滤语法
- Handler、Looper、Message
- react-native 问题总结
- 常见的正则表达式
- setTimeout()&setInterval()
- Java DES 加密和解密源码
- 8天学通MongoDB——第五天 主从复制
- anaconda2 安装
- 自定义WebView实现进度条显示和错误处理
- Admission to Exam
- RSYNC服务器模式