简体   繁体   English

React Native:以不同的分辨率测试应用

[英]React Native: Test app in different resolutions

What I am doing now is closing and opening different instances of Android Emulator to see how it works in X resolution . 我现在要做的是关闭和打开Android Emulator的不同实例,以了解它在X分辨率下的工作方式

Is there a smarter way? 有没有更聪明的方法?

If your react-native app has a single root react-native-layout-tester is what you are looking for! 如果您的react-native应用程序只有一个根,那么您正在寻找的是react-native-layout-tester

The setup is fairly straightforward and you will have to run it on the biggest device possible (a tablet) 设置非常简单,您将不得不在最大的设备(平板电脑)上运行

 render() { return ( <LayoutTester> // here <Provider store={ store }> <Router initialRoute={ this._initialRoute } ref={ this._setRouter } /> </Provider> </LayoutTester> ); } 

In case your app navigation is handled via react-native-navigation , then the setup will be a little complex and you wont be able test the Navbar. 如果您的应用导航是通过react-native-navigation ,则设置会有些复杂,您将无法测试Navbar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React-Native:如何缩放字体大小以支持Android和iOS中的许多不同分辨率和屏幕? - React-Native: How to scale font size to support many different resolutions and screens in both Android and iOS? 测试数据库以进行本机应用程序开发 - test database for react-native app development 使用 Firebase TestLab 测试 React Native App - Test React Native App using Firebase TestLab 如何在开发人员的应用程序审查中测试本机反应? - How to test react native in app review in dev? 单元测试使用带有Jest的Native Modules的React Native应用程序 - Unit test React Native app that uses Native Modules with Jest 需要一个测试框架来测试IOS Native + React native App - Need a Test Framework for testing IOS Native + React native App React-Native和Expo:create-react-native-app和react-native init之间的任何区别 - React-Native and Expo: Any different between create-react-native-app and react-native init 在React本机应用程序屏幕上的不同项目上应用不同的动画 - Apply different animations on different items in a screen of React native app React Native App 设计在不同的 IOS 设备上是不同的 - React Native App design is different in different IOS Device 在一个 React Native 应用程序中捆绑不同的应用程序版本 - Bundling different app versions in one React Native app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM