Forum Xamarin.Forms

iOS StatusBar, padding and background color.

nicktheonenicktheone Member ✭✭

I have an app with simple ListView inside a ContentPage which represent one of the pages of a TabbedPage view. Said app has a background color different from the iOS default and that proved to be an issue when in the page containing the ListView I wanted to move the whole list down a notch (pun intended) to leave some space for the StatusBar: this created a white space between the top of the screen and the beginning of my list, just under the StatusBar, showing the iOS default background color.
I tried searching for a hint about what I could do but apart from a really complicated snippet of code everyone suggested said solution or abandoning the idea of having a custom background color. The whole thing rubbed me wrong and through sheer ingenuity I thought that maybe I could set both the background color of the ListView and the ContentPage on the same color and surprisingly it worked.
Now my question is: was that just a case of weak Google-fu on my side not finding anyone suggesting this solution or none is suggesting it because of the (obvious) implications I fail to see?

Anyway, I went from this (disregard the lack of the clock on the bar, I don't even know how it happened):

To this:

Best Answer


  • nicktheonenicktheone Member ✭✭
    Thanks for the help.

    I definitely used the UseSafeArea property of the page in XAML although I made it look like I was setting the padding manually.
Sign In or Register to comment.