2015-08-25 32 views
2

如何在appcompat主題中實現沒有操作欄的黑屏?我已經實現了導航抽屜,其中主題來自style.xml。黑暗的活動與Android compat沒有操作欄?

這裏是我的當前主題:

<resources> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
    <item name="android:statusBarColor">@android:color/transparent</item> 
    <item name="android:windowTranslucentStatus">true</item> 
    </style> 
</resources> 

回答

7

簡單。

parent="Theme.AppCompat.NoActionBar" 
+0

哦,好吧,這麼簡單的: -D你也知道我可以如何改變導航抽屜的顏色嗎?這是stil白色^^ – lis

+0

設置抽屜佈局的backgrount。 –

0

爲此,您可以在活動中您的onCreate方法,像這樣:

ActionBar actionBar = getActionBar(); 
if (actionBar != null) { 
     actionBar.hide(); 
} 
+1

getSupportActionBar for AppCompatActivity –

+0

yes對於AppCompatActivity,您可以使用getSupportActionBar – Sami

0

這將是你的styles.xml

<resources> 
    <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> 
     <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
     <item name="android:statusBarColor">@android:color/transparent</item> 
     <item name="android:windowTranslucentStatus">true</item> 
    </style> 
</resources> 
相關問題