XAML - AbsoluteLayout help

voidstreamvoidstream FRMember ✭✭✭

Hello guys,

I'm trying to have a width of screen and an autosize height for my SearchStackLayout. Which bounds and flags i should use?

I have this XAML:

    <AbsoluteLayout>
        <maps:Map AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All"
                  MapType="Street"/>
        <StackLayout x:Name="SearchStackLayout" BackgroundColor="Aqua"
                     Padding="20">
            <StackLayout.Resources>
                <ResourceDictionary>
                    <Style TargetType="Label">
                        <Setter Property="Margin" Value="0,20,0,0"/>
                        <Setter Property="HeightRequest" Value="20"/>
                        <Setter Property="FontAttributes" Value="None"/>
                        <Setter Property="FontSize" Value="12"/>
                        <Setter Property="TextColor" Value="{DynamicResource TextColorTab}"/>
                    </Style>
                    <Style TargetType="DatePicker">
                        <Setter Property="TextColor" Value="{DynamicResource TextColorTab}"/>
                    </Style>
                </ResourceDictionary>
            </StackLayout.Resources>            
            <Label Text="Du"/>
            <DatePicker Format="{StaticResource DateFormatComplete}"/>
            <Label Text="Du"/>
            <DatePicker Format="{StaticResource DateFormatComplete}"/>
            <Label Text="Poste"/>
            <Picker/>
            <Button Margin="0,20,0,0" Style="{DynamicResource FormButton}" Text="Rechercher"/>
        </StackLayout>
    </AbsoluteLayout>

Best Answer

Answers

  • voidstreamvoidstream FRMember ✭✭✭

    No one really? :neutral:

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    @TonyPinot,

    Try this:

    <StackLayout  x:Name="SearchStackLayout" BackgroundColor="Aqua" Padding="20" AbsoluteLayout.LayoutBounds="0,0,1,-1" AbsoluteLayout.LayoutFlags="All">
    
  • voidstreamvoidstream FRMember ✭✭✭

    @JohnMiller said:
    @TonyPinot,

    Try this:

    <StackLayout  x:Name="SearchStackLayout" BackgroundColor="Aqua" Padding="20" AbsoluteLayout.LayoutBounds="0,0,1,-1" AbsoluteLayout.LayoutFlags="All">
    

    Not working, the stacklayout is not display on my screen :(

  • voidstreamvoidstream FRMember ✭✭✭
    edited February 2017

    @JohnMiller said:
    @TonyPinot,

    Sorry, I meant to change the Flags too. Here is what I wanted you to try:

    <StackLayout  x:Name="SearchStackLayout" BackgroundColor="Aqua" Padding="20" AbsoluteLayout.LayoutBounds="0,0,1,-1" AbsoluteLayout.LayoutFlags="PositionProportional,WidthProportional">
    

    Thanks
    I read the xamarin doc but i got difficult to understand how works LayoutFlags (more flags, priorities?) can you explain me a little?

Sign In or Register to comment.