How to remove Top/Bottom padding from a ContentPage/StackLayout

TimTurnerTimTurner USMember

I'm struggling to understand where there is a slight padding at the top of my application in Android as shown in the image:

image

My StackLayout has Spacing = 0 and Padding = new Thickness(0). Why is the ProgressBar not immediately under the notification bar?

I appreciate any help! Thanks!

Answers

  • TimTurnerTimTurner USMember

    I had already done exactly what is outlined in that link.

    var layout = new StackLayout() { Spacing = 0, Padding = 0, BackgroundColor = Color.White, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand };

  • HunumanHunuman GBMember ✭✭✭✭

    @TimTurner

    Have you set the ContentPage's Padding?

    Tim

  • TimTurnerTimTurner USMember

    Yes, I have.

    MainPage = new ContentPage { Padding = 0, Title = "Title", Content = layout };

  • TimTurnerTimTurner USMember
    edited May 2016

    progressBar = new ProgressBar { Margin = new Thickness(0), Progress = 1, VerticalOptions = LayoutOptions.Start, BackgroundColor = Color.Red };

    I updated the background color so that you can more clearly see what is happening. I've also included my code for the ProgressBar in my layout. It would appear that the ProgressBar has padding, but this property is not available on ProgressBar.

  • Marc.3202Marc.3202 USMember

    Did you solve it?

  • RodeKubaiziRodeKubaizi USMember ✭✭

    any news guys?

Sign In or Register to comment.