是否有可能在本机反应中使应用程序以纵向模式运行但是在横向模式下运行一个页面?我知道在xcode中你必须在开头选择肖像或风景,所以我对如何制作应用程序肖像中的所有页面有点困惑,除了一个.
Ajm*_*san 15
在 React Navigation v6 中你可以这样做:
<AppStack.Screen
name="VehiclesDetailsAuction"
component={VehiclesDetailsAuction}
options={{ orientation: 'portrait' }}
/>
<AppStack.Screen
name="VehicleImageView"
component={VehicleImageView}
options={{ orientation: 'all' }}
/>
Run Code Online (Sandbox Code Playgroud)
有一个非常完善的包:反应本地方向
唯一的缺点是,您需要在应用的每个场景中指定方向:
Orientation.lockToPortrait();
要么
Orientation.lockToLandscape();
归档时间: |
|
查看次数: |
4418 次 |
最近记录: |