xamarin/Xamarin.Forms

[Bug] Xamarin Form Shell RelativeLayout iOS: page content starts lower than expected

Open

#8,516 opened on Nov 14, 2019

 (2 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/layouta/shell :shell:e/5 :clock5:help wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

The page content (Y) starts below the navigation bar and a top bar, even thought we do not have a top bar defined. Doesn't work on iOS but works as expected on Android.

Steps to Reproduce

  1. Shell
<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
       xmlns:dashboard="clr-namespace:yyyyyy.Features.Dashboard"
       x:Class="yyyyyy.AppShell">
    <FlyoutItem Title="Dashboard">
        <dashboard:DashboardPage />
    </FlyoutItem>   
</Shell>
  1. Dashboard Page with RelativeLayout
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="yyyyyy.Features.Dashboard.DashboardPage"
             Title="Dashboard">
    <ContentPage.Content>
        <RelativeLayout VerticalOptions="FillAndExpand">
            <StackLayout BackgroundColor="Lime"
                         VerticalOptions="FillAndExpand"
                         RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X}"
                         RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y}"
                         RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width}"
                         RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height}">
            </StackLayout>
        </RelativeLayout>
    </ContentPage.Content>
</ContentPage>

Expected Behavior

The background color lime would fill all of the screen below the navigation bar.

Actual Behavior

There is a padding between the navigation bar and the RelativeLayout, I am assuming this is where the top tab bar would be.

Basic Information

  • Version with issue: 4.3.0.991211
  • IDE: Visual Studio For Mac 8.3.4 build 8
  • Platform Target Frameworks:
    • iOS: Deployment Target 11.0
  • Affected Devices: iPhone 8 and XI iOS 13.1 Simulator, iPhone 6 iOS 12.3,

Screenshots

Screen Shot 2019-11-14 at 6 08 17 PM

Contributor guide