In the Android UI design, we often need to set the screen to no title bar or full screen. It is very simple to implement, and there are two main ways to do this: Configure the XML file and write code settings.
1. Configuring in an XML file
In the project's manifest file Androidmanifest.xml, find the activity that needs to be full-screen or set to an untitled bar, where the activity is configured as follows.
To achieve full-screen effects:
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
Implement a untitled bar (but with the system's own taskbar):
Android:theme= "@android: Style/theme.notitlebar"
2. Writing Code settings
Write code in the program to set, just add the following code in the OnCreate () method to
To achieve full-screen effects:
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Implement a untitled bar (but with the system's own taskbar):
Requestwindowfeature (Window.feature_no_title);
Attached: Android system comes with style
Android:theme= "@android: Style/theme.dialog" displays an activity as a dialog box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, fullscreen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, fullscreen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" uses the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, fullscreen
Android:theme= "translucent" Transparent background
Android:theme= "Theme.Translucent.NoTitleBar" Transparent background with no title
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" Transparent background with no caption, fullscreen
Android:theme= "Theme.panel" Panel style display
Android:theme= "Theme.Light.Panel" tablet style display
How to achieve full screen in Android, remove title bar effect