react-native 学习笔记

来源:互联网 发布:剑倚天下宠物进阶数据 编辑:程序博客网 时间:2024/06/05 10:16

react-native 修改端口  react-nativestart--port9999

参考      http://blog.csdn.net/qq_16559905/article/details/56852208

调出重新加载页面 adb shell input keyevent 82

react-native arr 操作http://www.imooc.com/article/14400

npm install 不动  http://blog.csdn.net/iamfreedom2011/article/details/53375245


git 提交代码的命令:

  1. git status  
  2. git pull
  1. git add --all  
  1. git commit -m <comment>  
  1. git push -u origin master  
  2. 反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:

    git reset --hardgit pull

    其中git reset是针对版本,如果想针对文件回退本地修改,使用

    [plain] view plain copy
    1. git checkout HEAD file/to/restore  


找不到依赖 添加这个包



npm install babel-plugin-import --save-dev
android 打包
建assert目录,在项目根目录执行
React-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest 
android/app/src/main/res/
到安卓目录下运行,打包
C:\Users\xupf-c\.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9\gradle-3.3\bin\gradle assembleRelease
参考 http://blog.csdn.net/zrina1314/article/details/75452654 
http://blog.csdn.net/xiangzhihong8/article/details/70162784

ios  打包

建assert目录,在项目根目录执行

react-native bundle --entry-file index.ios.js  --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle

jsCodeLocation  = [[NSBundle mainBundle] URLForResource:@"index.ios" withExtension:@"jsbundle"];



WebView 使用:

<WebView
          style={{width:width,backgroundColor:'gray'}}
          source={{uri:"http://192.168.127.188/#/app/tech/home"}}
          javaScriptEnabled={true}
          domStorageEnabled={true}
          startInLoadingState={true}
          scalesPageToFit={false}
           decelerationRate="normal"
             automaticallyAdjustContentInsets={false}
          />



react-native-vector-icons的使用

http://blog.csdn.net/yeputi1015/article/details/70331912   

原创粉丝点击