Relative Layout in Xamarin Forms

DeveshMishraDeveshMishra USMember ✭✭
edited June 2017 in Xamarin.Forms

Hi,

I am creating one relative layout where i am creating one Frame box in the center of page, which is working fine. Now I want to place one Activity Indicator just above 10px from the Frame box. Below is code snippet.

<RelativeLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
    <Frame x:Name="landscapeframebox"
            RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
                Property=Width,Factor=0.8,Constant=0}"
            RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
                Property=Width,Factor=0.1,Constant=0}"
            RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, 
                Property=Height,Factor=0.5,Constant=0}"
            RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
                Property=Height,Factor=0.25,Constant=0}">
    </Frame>

    <ActivityIndicator IsRunning="True"
        RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,
                Property=Height, Factor=1, Constant=-10, ElementName=landscapeframebox}"
        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
                Property=Width, Factor=0.5, Constant=0}" />

</RelativeLayout>

Using the above mentioned code, Activity Indicator is not placing properly above the Frame box. Also let me know, how i can place Activity Indicator in center in a horizontal manner above the Frame box.

Can someone tell me what exactly mistake i am doing here ?

Answers

Sign In or Register to comment.