How to set the status bar color to transparent?

mc 4,616 Reputation points
2021-04-20T09:39:37.59+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,364 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,961 Reputation points
    2021-04-20T13:45:53.157+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.