title: Layout items in Relative Layout (XAML)
body: <p>I am trying to have an image that is horizontally centred, and then a text box positioned below it, also centred horizontally. </p>
  
  <p>From all of the examples that I have seen, the widths and heights of the relative views need to be known before hand to hard code it. Surely this is not the case?</p>
  
  <p>Here is what I have tried so far.</p>
  
  <pre><code>        &lt;RelativeLayout&gt;
          &lt;Image x:Name="logo" Source="logo.png" HorizontalOptions="CenterAndExpand"/&gt;
  
          &lt;StackLayout Orientation="Horizontal"
              BackgroundColor="Lime"
              RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, 
                                      Property=Width,
                                      Factor=0.5"
              RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, 
                                      ElementName=logo
                                      Property=Y,
                                      Constant=100}"&gt;
              &lt;Entry Text="{Binding Email, Mode=TwoWay}" Keyboard="Email" x:Name="signUpemailEntry" Placeholder="Email" TextColor="#2980b9" WidthRequest="270"  BackgroundColor="Fuchsia"&gt;
                  &lt;Entry.Behaviors&gt;
                      &lt;behave:EmailValidatorBehaviour x:Name="signUpemailValidator"/&gt;
                   &lt;/Entry.Behaviors&gt;
              &lt;/Entry&gt;
  
              &lt;Image x:Name="signUpemailSuccessErrorImage"
                    Style="{Binding Source={x:Reference emailValidator}, 
                            Path=IsValid, 
                            Converter={StaticResource boolToStyleImage}}"/&gt;
         &lt;/StackLayout&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>