79424876

Date: 2025-02-09 12:31:13
Score: 0.5
Natty:
Report link

According to the official documentation:

If the app targets VANILLA_ICE_CREAM or above, the color will be transparent and cannot be changed.

This means that if your app targets android 15 or higher, the system bars (status bar and navigation bar) will automatically match the background color of your view since edge-to-edge is enforced.

If you only want to change the color of the status bar, you could create a spacer view with full width and no height. Apply WindowInsets as padding to match the status bar height.

please refer to:

https://developer.android.com/reference/android/view/Window#setStatusBarColor(int)

https://developer.android.com/develop/ui/views/layout/edge-to-edge#system_bar_protection

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Ibrahim Zulfiqar