随笔分类 -  react-native

摘要:onShouldStartLoadWithRequest = (e) => {// Implement any custom loading logic here, don't forget to return!// 解决WebKitErrorDomain code:101的警告// http:// 阅读全文
posted @ 2019-03-21 15:17 年少的你如此美丽 阅读(2649) 评论(0) 推荐(0)
摘要:React Native WebView关闭缓存 网上搜索没有找到关闭React Native下webview控件的缓存的方法,经测试找到解决方案,记录如下 核心思路:通过请求时设置请求头,使页面缓存过期 关键代码 核心代码: 在source里面指定headers中的Cache-Control为no 阅读全文
posted @ 2019-03-19 17:11 年少的你如此美丽 阅读(2642) 评论(0) 推荐(0)
摘要:需求 在用WebView组件写一个东西,要求功能:打开web后进行js代码注入。 开发 代码很简单,示例: const js = ` alert(1); alert(2); `; <WebView source={{ uri: 'http://web.com' }} injectedJavaScri 阅读全文
posted @ 2019-03-12 15:33 年少的你如此美丽 阅读(1029) 评论(0) 推荐(0)
摘要:此外,这种方案会全局改掉字体,覆盖系统默认字体,可以试试改成 fontFamily: '',这样不会覆盖默认字体,出问题的 Text 组件也可以显示正常~ 阅读全文
posted @ 2019-03-04 16:13 年少的你如此美丽 阅读(1479) 评论(0) 推荐(0)
摘要:➜ ~ adb install /Users/jkr/Downloads/QYVideoClient-debug.apk /Users/jkr/Downloads/QYVideoClient-deb.... 3.4 MB/s (60889146 bytes in 16.954s) pkg: /dat 阅读全文
posted @ 2019-02-27 22:26 年少的你如此美丽 阅读(638) 评论(0) 推荐(0)
摘要:react-native run-ios --simulator "iPhone 7 Plus” xcrun instruments -w 'iPhone X' 阅读全文
posted @ 2018-12-06 16:25 年少的你如此美丽 阅读(487) 评论(0) 推荐(0)
摘要:render() { return ( 2 this.props.navigation.push('Profile')} /> this.props.navigation.navigate('Home')} ... 阅读全文
posted @ 2018-11-28 11:31 年少的你如此美丽 阅读(1449) 评论(0) 推荐(0)
摘要:const ScreenWidth = Dimensions.get('window').width; static DimensionsTransform(px) { // 设计图纸以750为基准 return px/750*ScreenWidth } 阅读全文
posted @ 2018-11-26 15:17 年少的你如此美丽 阅读(279) 评论(0) 推荐(0)
摘要:在RN0.44版本之前,路由导航跳转几乎是使用的是Navigator组件,在0.44版本以后就不推荐使用了,官方推荐的是react-navigation,当然还是可以在废弃的库中找到: import { Navigator } from 'react-native-deprecated-custom 阅读全文
posted @ 2018-11-16 17:57 年少的你如此美丽
摘要:import { Component } from 'react'; import { StyleSheet, View, Text, TouchableOpacity, ScrollView, Dimensions } from 'react-native'; const dimen = Dimensions.get('window'); co... 阅读全文
posted @ 2018-11-01 17:57 年少的你如此美丽 阅读(715) 评论(0) 推荐(0)
摘要:stickySectionHeadersEnabled={true} stickyHeaderIndices={[0]} 阅读全文
posted @ 2018-11-01 15:10 年少的你如此美丽 阅读(464) 评论(0) 推荐(0)
摘要:import { Platform, Dimensions } from 'react-native'; // iPhoneX const X_WIDTH = 375; const X_HEIGHT = 812; // screen const SCREEN_WIDTH = Dimensions.get('window').width;... 阅读全文
posted @ 2018-10-30 11:51 年少的你如此美丽 阅读(940) 评论(0) 推荐(0)
摘要:"babel-plugin-transform-decorators-legacy": "^1.3.5", "babel-preset-react-native-stage-0": "^1.0.1", "mobx": "^3.2.2", "mobx-react": "^4.2.2", .babelr 阅读全文
posted @ 2018-09-18 18:07 年少的你如此美丽
摘要:首先初始化项目报错: 解决方法: 将这个版本号改为: 然后将这里: 改为: 版本号相对应 然后便可安装成功! 【注:转载:https://blog.csdn.net/wwrzyy/article/details/72823029】 阅读全文
posted @ 2018-04-30 17:51 年少的你如此美丽 阅读(400) 评论(0) 推荐(0)
摘要:一、开发环境搭建-windows平台; 阅读全文
posted @ 2018-04-23 14:25 年少的你如此美丽 阅读(130) 评论(0) 推荐(0)