Events on elements in Relative Layout not firing

JPHochbaumJPHochbaum USMember ✭✭✭

I am using Xamarin Forms and events on elements inside of a relative layout are not firing. I tried to register them in code behind as well and still not firing. Here is my xaml:

<RelativeLayout
        IsEnabled="True">
        <Button x:Name="SaveBtn"
                IsEnabled="True"
                WidthRequest="100"
                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0, Constant=-250}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=0, Constant=10}"
                Clicked="SaveBtn_Clicked"
                Text="Save"></Button>
        <Button x:Name="ClearFavorites"
                IsEnabled="True"
                WidthRequest="120"
                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0, Constant=-250}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5, Constant=30}"
                Clicked="ClearFavorites_Clicked"
                Text="Clear Favorites"></Button>
</RelativeLayout>

Answers

  • JPHochbaumJPHochbaum USMember ✭✭✭

    So I know why it is not firing, the negative constraint is bleeding into the other relative layout. How do I set the height of a relative layout? Nothing I try seems to work.

Sign In or Register to comment.