下载了个例子,真机安装,使用命令:react-native run-android 安装运行到手机上后总是白屏。
例子的index.android.js如下:
@H_404_5@ import { AppRegistry,Text,View,TouchableOpacity, StyleSheet,Navigator} from 'react-native';下载了个例子,真机安装,使用命令:react-native run-android 安装运行到手机上后总是白屏。
例子的index.android.js如下:
@H_404_5@ import { AppRegistry,Text,View,TouchableOpacity, StyleSheet,Navigator} from 'react-native';
解决方法:
1,首先解决白屏的问题
手机上打开app后白屏,摇一摇也没有开发者菜单:手机设置——》“其他应用管理”——》找到刚安装的应用程序,并打开——》“权限管理”——》“显示悬浮框”;
此时重启app,再摇一摇就可以出来开发者菜单,在开发者菜单中启动远程调试,可以看到程序输出的错误:
'Navigator is deprecated and has been removed from this package. It can now be installed and imported from `react-native-deprecated-custom-components` instead of `react-native`.
2,解决导航问题
npm installreact-native-deprecated-custom-components --save
2)实现了使用谷歌浏览器结合针灸进行远程调试的方法,可设置断点跟踪调试;
3)导航功能的使用。