Sie folgende Schritte tun müssen,
v21/styles.xml
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorStatusBarColor</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<!--Required Api 21 above-->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
Hinweis: oben Stil hinzufügen, ohne Code v21 in styles.xml
diesen Stil in AndroidManifest.xml
Nehmen als `android: Thema
android:theme="@style/AppTheme.NoActionBar">
Jetzt einfach Ihre Aktivitäten gehen & Add Code in onCreate
Methode folgende Zeile,
private Window mWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
mWindow = getWindow();
mWindow.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
Run jetzt & Ausgang dieses mögen,
Können Sie beziehen sich auf diesen Link (https://stackoverflow.com/questions/29907615/android-transparent-status-bar-and-actionbar) –
Ahh große lassen Sie mich –