Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

XF >1.3.4 Can't set StackLayout HorizontalOptions to Center

$
0
0

I have been developing a Xamarin Forms app using XF 1.3.3 for a while now. I recently updated to 1.3.4 to give it a test. The stacklayouts kept displaying as broken (I have lots of StackLayouts with HorizontalOptions set to Center or CenterAndExpand) and they were autoexpanding to take up the full width. I reverted back to 1.3.3 to fix it. Now I really need to update to 1.4 (Because of XLabs), however my StackLayouts keep expanding to take up the entire screen.

Sample View (No CodeBehind changes are made to this XAML)


<ContentPage.Resources>
    <ResourceDictionary>
    </ResourceDictionary>
</ContentPage.Resources>

<AbsoluteLayout x:Name="Host" VerticalOptions="FillAndExpand" HorizontalOptions="Fill">
    <StackLayout x:Name="ScrollStack" Orientation="Vertical" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
        <ScrollView x:Name="Scroll" VerticalOptions="FillAndExpand" HorizontalOptions="Center">
            <ScrollView.Padding>
                <OnPlatform x:TypeArguments="Thickness"
                    iOS="0, 20, 0, 0">
                </OnPlatform>
            </ScrollView.Padding>

            <StackLayout x:Name="Stack" Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="Center" Padding="30" BackgroundColor="{x:Static Sentinel:AppColours.THEME_60}">
                <Controls:PinEntry x:Name="PinEntry" PinLength="8" Prompt="ENTER PIN:" HorizontalOptions="Center"></Controls:PinEntry>
            </StackLayout>
        </ScrollView>
    </StackLayout>
</AbsoluteLayout> 
</Controls:StandardPage>

Previously, PinEntry (Just a ContentView with some images in it) only took up as much room as needed in the middle of the screen. Now it spans the entire screen. I believe this may have to do with the new Stacklayout rendering, but I can't be too sure.

Cheers

(First post so let me know how I can add more info to aid anyone's investigations)


Viewing all articles
Browse latest Browse all 58056

Trending Articles