Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Relative Layout in Xamarin Forms

DeveshMishraDeveshMishra USMember ✭✭
edited June 2017 in Xamarin.Forms


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,
            RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
            RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, 
            RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,

    <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}" />


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 ?


Sign In or Register to comment.