Commit c3228425 by tanghuan

强制竖屏显示

1 parent bf8df2fa
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<activity <activity
android:name=".PrivacyActivity" android:name=".PrivacyActivity"
android:exported="true" android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"> android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode">
<intent-filter> <intent-filter>
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
......
...@@ -16,6 +16,11 @@ import 'app.dart'; ...@@ -16,6 +16,11 @@ import 'app.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
// 强制竖屏显示
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
// 设置默认状态栏样式:透明背景 + 深色图标。 // 设置默认状态栏样式:透明背景 + 深色图标。
// 不使用 app.dart 中的全局 AnnotatedRegion,避免其覆盖各页面的 // 不使用 app.dart 中的全局 AnnotatedRegion,避免其覆盖各页面的
// 手动 SystemChrome.setSystemUIOverlayStyle 调用。 // 手动 SystemChrome.setSystemUIOverlayStyle 调用。
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!