0

我想隱藏特定窗口的操作欄。我跟着這個:http://www.appcelerator.com/blog/2014/08/hiding-the-android-actionbar/過去曾經爲我工作。鈦 - 隱藏特定窗口的Android操作欄

我所做的是創建一個自定義主題是這樣的:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="Theme.NoActionBar" parent="@style/Theme.AppCompat"> 
     <item name="android:windowNoTitle">true</item> 
    </style> 
    <style name="Theme.YesActionBar" parent="@style/Theme.AppCompat"> 
     <item name="android:windowNoTitle">false</item> 
    </style> 
</resources> 

我設置在我tiapp.xml如下:

<android xmlns:android="http://schemas.android.com/apk/res/android"> 
    <manifest> 
     <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" /> 
    </manifest> 
</android> 

而且我已經設置在我的窗口中輸入以下tss

"Window[platform=android]" : { 
    theme: 'Theme.NoActionBar' 
} 

但仍然操作欄顯示。如果我在窗口打開事件中將其隱藏起來,而不是削減背景圖像 - 所以我寧願使用主題。

如何在sdk 5.2.0上隱藏帶主題的動作欄?

回答

1

我能夠改變我的自定義主題,以這個來解決這個問題:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="Theme.NoActionBar" parent="@style/Theme.AppCompat"> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
    </style> 
    <style name="Theme.YesActionBar" parent="@style/Theme.AppCompat"> 
     <item name="windowActionBar">true</item> 
     <item name="windowNoTitle">false</item> 
    </style> 
</resources>