簡體   English   中英

在啟動屏幕活動期間進入全屏

[英]Enter full-screen during splash-screen activity

我目前正在嘗試在啟動屏幕“ Activity期間進入全屏模式。 我這樣做是通過style設置的,它是在Activity上設置的,如下所示:

style.xml

<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@drawable/background_splash</item>
</style>

AndroidManifest.xml

<activity
    android:name=".Activities.SplashScreenActivity"
    android:noHistory="true"
    android:screenOrientation="portrait"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

您可能會建議以編程方式執行此操作,但是我已經嘗試過thisthisthisthisthisthis鏈接的所有答案。 目前,沒有一種編程解決方案對我splashActivity.java —將每個建議的修復都放在我的splashActivity.java onResumeonCreate中,但是狀態和導航欄仍然可見。 但是,使用我的自定義style它僅隱藏狀態欄,導航欄保持可見。 到目前為止,我在xml文件中嘗試過的工作:使用樣式的不同父項,不使用背景可繪制,從activity刪除screenOrientationnoHistory 我很確定我在這里遺漏了一些東西,但是我看不到。 如果需要,可以共享更多代碼。 提前致謝!

這是我的SplashScreenActivity樣式:

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowBackground">@drawable/splash_logo_drawable</item>
</style>

我只使用屬性windowBackground

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM