wuyunqiang
wuyunqiang
找到路径: ``` ~/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services ``` 更新文件 android/gradle.properties 添加如下 googlePlayServicesVersion=11.0.4 (本地文件夹里面最高的版本) 参考: https://github.com/rebeccahughes/react-native-device-info/issues/384
``` 使用 PermissionUtil.checkPermission(success,fail,permission = []) /** * react-native-permissions 1.0.6 * Created by wuyunqiang */ import Permissions from 'react-native-permissions' class PermissionUtil{ checkPermission = (success,fail,permission = []) => { let self =...
``` import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import java.util.ArrayList; import java.util.List; public class PermissionUtils { /** * 检测权限 * *...
有时候使用webview需要查看发送的header信息是否正确发送,一般我们都是和后台配合来检验的。其实我们也可以自己来检验,自己启动一个node作为服务端,然后连接本地的node服务来查看header信息。 ``` var http = require('http'); var port = 9000; function logRequest(request) { console.log("request headers: ", request.headers) console.log("Processing request for: ", request.url) console.log('Time',new Date().toString()) } http.createServer(function(request, response) { response.writeHead(200, {"Content-Type":...
```js import React, { Component, PropTypes } from 'react'; import { Text, View, TouchableOpacity, StyleSheet, Platform, Dimensions, Image, Modal, TextInput, InteractionManager } from 'react-native'; export default class AlertModal extends Component...
``` react: ^16.3.0-alpha.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4 ``` ``` constructor(props){ super(props); this.header = { //header中不能有"_" 'xxxxx':'testing', //right 'xxx-xxx':'native', //right 'xxx_xxx':'native', //fail }; this.webviewParams = {}; } {this.web =...
 fix: ``` {this.web = webview}} style={{width:'100%',height:'100%',marginTop:this.isIphoneX()?40:Platform.OS==='ios'?20:0}} source={{uri: this.state.url}} domStorageEnabled={true} mixedContentMode={'always'}//指定混合内容模式。即WebView是否应该允许安全链接(https)页面中加载非安全链接(http)的内容,never,always,compatibility onLoadEnd = {this.LoadEnd}//加载成功或者失败都会回调 onError = {this.isConnNet} javaScriptEnabled = {true}//指定WebView中是否启用JavaScript scalesPageToFit={true} onNavigationStateChange={(e) => { console.log("onNavigationStateChange",e) this.onNavigationStateChange(e) }} startInLoadingState={true} //强制WebView在第一次加载时先显示loading视图 bounces={true}//指定滑动到边缘后是否有回弹效果。...
版本0.46升级0.51 然后使用codepush发布更新 可以检测更新也可以下载,在重启应用时报错如下 如图:   关机重启后,再次点击更新还是报这个错。 1:关掉其他项目,关掉node等其他窗口 2:执行watchman watch-del-all && react-native start --reset-cache 3:重新再这个环境下上传应用至服务器更新 然后更新成功.
安装react-native-elements库文件 详见: https://github.com/react-native-training/react-native-elements/blob/master/default_installation.md SwipeDeck ios 运行结果:  Android 运行结果:  修改代码: SwipeDeck/renderCards如下:  结果:  zindex:是rn在0.30开始支持的属性。 zIndex controls which components display on top of others. Normally, you don't use zIndex....
``` import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import java.util.Random; public class CodeUtils { // private static final char[] CHARS = { // '0', '1', '2', '3', '4', '5',...