在android studio中,当我设置全屏模式时,我仍然无法使用屏幕上的所有空间(例如导航栏的空间)。
我该怎么办?
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".Game">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/start_game"
android:textColor="@color/white" />
第4行和第5行的match parent不考虑全屏模式。
这就是我让它全屏显示的方法:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION);
https://stackoverflow.com/questions/50670586
复制相似问题