最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

navigationbar - Android 15 navigation bar icons appear dark even on a dark background - Stack Overflow

programmeradmin0浏览0评论

My app uses this theme (it has no light variant):

<style name="AppBase" parent="@android:style/Theme.Material.NoActionBar">
    ...
    <item name="android:forceDarkAllowed">false</item>
    <item name="android:colorControlNormal">[DARK COLOR]</item>
    <item name="android:background">[DARK COLOR]</item>
    <item name="android:navigationBarColor">[DARK COLOR]</item>
    <item name="android:statusBarColor">[DARK COLOR]</item>
    <item name="android:windowLightStatusBar">false</item>
    <item name="android:windowLightNavigationBar">false</item>
</style>

I do not use AppCompat, third party libraries or anything else... Just plain Android classes and styles (and I intend to keep like that).

My activity does not call window.setNavigationBarColor(...) or anything regarding any kind of colors at all.

I am already handling insets using setOnApplyWindowInsetsListener() (on API 35).

Before adding <item name="android:windowLightStatusBar">false</item> to the theme, the status bar icons were dark, even though my background is dark. Therefore, that XML line fixed the issue (this issue happened only on API 35).

Unfortunately, adding <item name="android:windowLightNavigationBar">false</item> appears to have no effect at all on the icons displayed by the system, and they remain dark (on API 35).

This behavior started on Android 15 (API 35). On API 34, 33, 32... the system has always used correct icons in the navigation and status bars (which means light icons because the background is dark).

This is a print of what the navigation bar looks on API 35:

Has anyone else come across this issue? How could I solve it?

Thanks, everyone!!!

发布评论

评论列表(0)

  1. 暂无评论