[英]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.