Why is this frame cut off?

I am confused why the Frame in this XAML is being cut off.

<?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="MobileMidstream.Pages.LoginPage">
    <ContentPage.Content>
        <StackLayout Orientation="Vertical">
            <Frame OutlineColor="Cornsilk"  
                   Padding="10"
                   VerticalOptions="Start"
                   HorizontalOptions="CenterAndExpand">
                    <Label Text="Username:" />
            </Frame>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

What changes to the XAML would I make to have the Frame anchor to the left side of the screen and fill across to the right side?

Tagged:

Best Answers

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    As a test... Hard code the size of the frame.
    I'm going to bet it comes down to rendering sequence...
    StackLayout constricts to the size of its contents...
    The contents are then resized to instructions of padding and expand
    But the StackLayout doens't resize to match the new size of the contents.

    Just a guess.

    Also... Emulators are notoriously bad for not behaving like real devices especially with respect to UI.
    So you might want to see what it does on a physical device.

Sign In or Register to comment.