When I apply the auto-generated AppTheme.NoActionBar
to my activity via android:theme
like so:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage">
<application
...
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.NoActionBar" />
</application>
</manifest>
My MainActivity is rendered with a transparent status bar at the top, which eventually has a white background, and white text over it. If the device is charging, that is the only symbol to be seen.
Transparent ActionBar from AppTheme.NoActionBar
Here is my values/styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
</resources>
In the second style, you can see AppTheme.NoActionBar
, which by default inherits AppTheme, however nowhere in either style specifies that the status bar should be transparent.