question

6666666 avatar image
0 Votes"
6666666 asked JarvanZhang-MSFT answered

How to set the status bar color to transparent?

I am using xamarni.forms android I have set the immersive mode

but the status bar color is:

89484-image.png

how to set the color to transparent?

dotnet-xamarin
image.png (14.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered

Hello,​

Welcome to our Microsoft Q&A platform!

The status bar of the immersive mode is semi-transparent on both native Android and Xamarin. Add settings in the style will not change the color. The following code will make the status bar totally transparent, however the status bar will be always shown. You could test the code in your project to check it.

<style name="MainTheme" parent="MainTheme.Base">
  <item name="android:statusBarColor">#00000000</item>
  <item name="android:windowTranslucentStatus">false</item>
  <item name="android:windowTranslucentNavigation">true</item>
  <item name="android:windowLightStatusBar">true</item>
</style>


Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.