2 years ago

#37723

test-img

Kajot

Xamarin overlapping problem Stacklayout, bindable layout

currently Im using a Stacklayout with a BindingLayout like this:

<StackLayout BindableLayout.ItemsSource="{Binding MessstelleGeraete}" >
    <BindableLayout.ItemTemplate>
        <DataTemplate>
            <StackLayout>
            <Grid RowSpacing="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <StackLayout Grid.Row="0">
                <---- some more stuff in here ---->
                </StackLayout>
                <StackLayout Grid.Row="0" Margin="-8,20,0,-20">
                    <BoxView Color="#0056AD" HeightRequest="2" WidthRequest="8" />
                    <BoxView Color="#0056AD" WidthRequest="2" HorizontalOptions="Start" VerticalOptions="FillAndExpand"/>
                    <BoxView Color="#0056AD" HeightRequest="2" WidthRequest="8" />
                </StackLayout>
            </Grid                      
            </StackLayout>
        </DataTemplate>
    </BindableLayout.ItemTemplate>
</StackLayout

If for example we have 5 items in "MessstelleGeraete" then whe have a Stacklayout with 5 Stacklayouts in it. Inside of the 5 Stacklayouts there is 2 more Stacklayouts. The first contains some laybels and entries the second one contains 3 boxviews that look like "[". The "[" is as long as the entire Grid. When I shift it down with the margin its supposed to overlap onto the next (of our 5) stacklayouts. The Problem here is that the z-index inside a stacklayout is determined by the order of the child elements. Which means element 2 will overlap element 1 but I need it the other way around.

enter image description here Left: "[" is cut off cuz Stacklayout 2/5 overlaps Stacklayout 1/5

How can I fix that? Can I use a RelativeLayout? If yes how?

xamarin

xamarin.forms

xamarin.android

stacklayout

0 Answers

Your Answer

Accepted video resources