在iPad上加载应用程序后,应用程序是颠倒的,手动旋转180度后,应用程序可以正常工作。
在真实的iPad设备上也是同样的行为,在Android上也能正常工作。
方向:在app.json配置中锁定为 "横向"。
我的App.js文件。
import React from 'react';
import { View, Text } from 'react-native';
const App = () => {
return (
<View style={{ flex: 1, backgroundColor: 'grey', justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ position: 'absolute', fontSize: 30, top: 0 }}>TOP</Text>
<Text style={{ position: 'absolute', fontSize: 30, left: 0 }}>LEFT</Text>
<Text style={{ position: 'absolute', fontSize: 30, right: 0 }}>RIGHT</Text>
<Text style={{ position: 'absolute', fontSize: 30, bottom: 0 }}>BOTTOM</Text>
</View>
);
};
export default App;
expo sdk: "^37.0.0"
我的app.json文件:"^37.0.0
{
"expo": {
"packagerOpts": {
"config": "metro.config.js",
"sourceExts": [
"js",
"jsx",
"ts",
"tsx",
"svg"
]
},
"name": "My Test App",
"slug": "my-test-app",
"privacy": "public",
"platforms": [
"ios"
],
"version": "1.2.6",
"orientation": "landscape",
"splash": {
"image": "./assets/splash2.png",
"resizeMode": "contain",
"backgroundColor": "#113F67"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "ru.my.testapp",
"buildNumber": "1.2.6",
"supportsTablet": true,
"isTabletOnly": true,
"requireFullScreen": true,
"infoPlist": {
"NSLocationWhenInUseUsageDescription": "location"
},
"config": {
"googleMapsApiKey": "api-key"
}
},
"description": ""
}
}