SoFunction
Updated on 2025-03-11

Summary of Android full screen setting methods

There are two ways to set full screen in Android.

The first method:Add the following code before () in protected void onCreate(Bundle savedInstanceState)

//Cancel title(Window.FEATURE_NO_TITLE);
//Cancel the status bar().setFlags(.FLAG_FULLSCREEN,
.FLAG_FULLSCREEN);

The second method:

① Create a file in the res/values ​​directory (this file note is mainly used to place styles), and the file contents:

<?xml version="1.0" encoding="utf-8"?>
<resources> 
<!-- name yesStyleName of,parent Inheriting the parent class style -->
<style name="theme_fullScreen" parent="android:"> 
<item name="android:windowNoTitle">true</item> <!-- Set Untitled -->
<item name="android:windowFullscreen">?android:windowNoTitle</item> <!-- yes否填充慢屏幕,Quoteandroid:windowNoTitle Value of -->
</style> 
</resources>

②In use:

<activity android:name=".LoginActivity" android:theme="@style/theme_fullScreen"/>

This will complete the full screen setting of Android

Thank you for reading, I hope it can help you. Thank you for your support for this site!