의 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>
내 MainActivity를 상단에는 투명 상태 표시 줄이 표시되고, 결국에는 흰색 배경이 있고 흰색 텍스트 위에는 흰색 텍스트가 표시됩니다. 장치가 충전 중이면 표시되는 유일한 기호입니다. AppTheme.NoActionBar 다음
에서
투명 액션 바 내 값/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>
두 번째 스타일에서, 당신은 AppTheme.NoActionBar
를 볼 수있는 기본적으로 AppTheme을 상속하지만 어느 스타일에도없는 경우 상태 표시 줄이 투명해야합니다. 이 문제가 건너 한 경우