簡體   English   中英

應用主題后,操作欄不顯示

[英]action bar does not show After applying theme

這是我的風格頁面:

<resources>
<color name="for_custom">#ff4db0e8</color>
    <style name="CustomTheme" parent="android:Theme.Light">
        <item name="android:windowBackground">@color/for_custom</item>
        <item name="android:actionBarTheme">@color/for_custom</item>
        <item name="android:displayOptions">homeAsUp</item>
    </style>
</resources>

這是我的清單:

<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/CustomTheme">

應用主題后,操作欄不顯示。為什么? 我怎么了

如果您使用的是Lollypop +,則默認主題為“材質”,而不會顯示ActionBar。 這是因為材料設計規范將“ 工具欄”視圖標記為保留按鈕的新方法。 如果您想使用舊樣式,請使用Theme.Holo.Light而不是Theme.Light

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM