
ReactNative
yingBi2014
这个作者很懒,什么都没留下…
展开
-
在react-native-vector-icons中使用自定义图标
react-native-vector-icons的安装参考链接这里主要介绍如何在react-native-vector-icons中使用iconfont官网上的图标。1、下载图标素材首先在iconfont网站上挑选好图标,或者自己的设计将图标上传上去之后,加入购物车,选好所有的图标后, 在购物车选择下载代码。解压后得到如下文件这里我们只需要iconfont.tff文件和iconf...原创 2019-11-08 17:00:33 · 1018 阅读 · 0 评论 -
安装react-native-vector-icons并使用默认图标
1、 安装使用npm安装react-native-vector-iconsnpm install react-native-vector-icons --save2、cocoapods安装进入iOS目录执行 pod install 安装 RNVectorIconsPS: 如果iOS项目编译爆红提示Multiple commands produce xxx.ttf之类的说明字体文件重...原创 2019-11-08 15:11:23 · 1433 阅读 · 0 评论 -
ReactNative使用npm安装第三方包
安装npm install xxx --save卸载npm uninstall xxx --save安装完成后,在package.json中会自动添加第三方的版本记录。RN 0.60及更新版本不需要再手动link了,会自动link。老版本参考...原创 2019-10-28 17:24:23 · 519 阅读 · 0 评论 -
ReactNative绑定函数中的this
在一个button的onpress方法中传进一个函数back,这个函数中如果用到this的话,需要将back中的this进行绑定操作。1、传入时进行绑定onPress={this.back.bind(this)}2、在constructor中绑定constructor(props){ super(props) this.state = { show : true, }...原创 2019-10-14 11:00:13 · 334 阅读 · 0 评论 -
将ReactNative集成到现有项目中的注意事项
按照官方文档将RN添加到现有项目后,用终端运行react-native run-ios --simulator "iPhone 8"时,提示错误iOS project folder not found. Are you sure this is a React Native project运行失败的原因是在项目根目录中,原生项目的文件夹名称必须改为ios,否则rn脚本找不到对应的iOS项目...原创 2019-10-09 11:26:41 · 712 阅读 · 0 评论 -
搭建ReactNative环境
1、安装node watchmanbrew install nodebrew install watchman安装完成后修改下npm镜像,参考链接npm config set registry https://registry.npm.taobao.org --globalnpm config set disturl https://registry.npm.taobao.org/ -...原创 2019-10-10 15:40:18 · 283 阅读 · 0 评论