Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit c3228425
authored
2026-09-03 16:31:36 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
强制竖屏显示
1 parent
bf8df2fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
android/app/src/main/AndroidManifest.xml
lib/main.dart
android/app/src/main/AndroidManifest.xml
View file @
c322842
...
@@ -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"
...
...
lib/main.dart
View file @
c322842
...
@@ -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 调用。
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment