2016-06-03 6 views
9

kullanarak:Android Durum Çubuğu ben otomatik oluşturulan şöyle <code>android:theme</code> aracılığıyla benim aktiviteye <code>AppTheme.NoActionBar</code> uyguladığınızda AppTheme.NoActionBar

AndroidManifest.xml: olduğunu

<?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> 

Benim MainActivity Üstünde şeffaf bir durum çubuğu ile işlenen, sonunda beyaz bir arka plan ve üzerinde beyaz bir metin var. Cihaz şarj oluyorsa, görülmesi gereken tek sembol budur. AppTheme.NoActionBar İşte

den

Transparent ActionBar

Şeffaf İşlem Çubuğu benim değerler/styles.xml geçerli:

<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> 

ikinci tarzında, sen, AppTheme.NoActionBar görebileceğiniz varsayılan olarak, AppTheme'i alır, ancak her iki durumda da durum çubuğunun saydam olmamasını belirtir. Bu konuyla karşılaşanlar eğer

cevap

İlgili konular