在关注关于 twa 的Google Developers 页面并隐藏 url 栏之后,我现在有了一个没有 url bar 的工作 twa。但状态栏仍然可见。
是否可以在 twa 中隐藏 StatusBar 以获得全屏视图?
AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/battlechoc_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:screenOrientation="landscape"
android:theme="@style/Battlechoc.Fullscreen.Theme"
tools:ignore="GoogleAppIndexingWarning">
<meta-data
android:name="asset_statements"
android:value="@string/asset_statements" />
<activity
android:name="android.support.customtabs.trusted.LauncherActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@style/Battlechoc.Fullscreen.Theme">
<meta-data
android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="https://battlechoc.com" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="@string/hostname"/>
</intent-filter>
</activity>
</application>
样式.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Battlechoc.Fullscreen.Theme" parent="@style/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>
</style>