Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android窗口全屏,无操作栏_Android - Fatal编程技术网

Android窗口全屏,无操作栏

Android窗口全屏,无操作栏,android,Android,通过编写以下代码,我已经使我的应用程序全屏显示,没有标题 <item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> true 真的 但我可以像通常一样从顶部打开操作栏和通知栏。 有没有办法永远不显示顶级动作条 全屏应用程序: 可见状态栏: 只要我从顶部触摸并向下滑动,移动状态栏就会显示出来。如何阻止这种情况

通过编写以下代码,我已经使我的应用程序全屏显示,没有标题

<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
true
真的
但我可以像通常一样从顶部打开操作栏和通知栏。 有没有办法永远不显示顶级动作条

全屏应用程序:

可见状态栏:

只要我从顶部触摸并向下滑动,移动状态栏就会显示出来。如何阻止这种情况

更新:

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
</style>
android:theme="@style/AppTheme"
AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sampleapp">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTask"
            android:stateNotNeeded="true"
            android:theme="@style/AppTheme.Wallpaper">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name=".LockScreenActivity" />
    </application>
</manifest>

styles.xml

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <!-- THIS IS THE MAIN THEME -->
    <style name="AppTheme.Wallpaper" parent="@style/Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowShowWallpaper">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
    </style>
</resources>

@颜色/原色
@颜色/原色暗
@颜色/颜色重音
真的
@android:彩色/透明
真的
真的

在style.xml中使用此代码

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
</style>

试试这个

   @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            this.requestWindowFeature(Window.FEATURE_NO_TITLE);
            this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
            setContentView(R.layout.activity_main);
    }
在style.xml中:

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
</style>
android:theme="@style/AppTheme"

可能重复的可能重复的编号。不是重复。我用一些截图更新了我的问题,使之更加具体。蒂亚诺。仍会在向下滚动时显示该条。更新您的清单删除此行android:theme=“@style/AppTheme.Wallpaper”