title: Stack Layout layout nightmare with Xamarin XAML forms
body: <p>I have the following code:</p>
  
  <pre><code>  &lt;StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="0,10,0,10" BackgroundColor="Green" Padding="5,5,5,5"&gt;
          &lt;StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Margin="0,0,0,0" BackgroundColor="Blue"&gt;
                &lt;Label Text="SHOW COMPLETED TASKS" BackgroundColor="Red" Style="{StaticResource lblSubHeading_Black}" /&gt;
          &lt;/StackLayout&gt;
          &lt;Switch x:Name="CompletedJobsSwitch" Toggled="CompletedJobsSwitch_Toggled" HorizontalOptions="EndAndExpand" IsToggled="{Binding isOn}" BackgroundColor="Yellow"/&gt;
    &lt;/StackLayout&gt;
  </code></pre>
  
  <p>It all loads fine but when the app loads it is showing, but the Switch is not flush right. Why? It's really annoying, seems really inconsistent<a href="https://i.stack.imgur.com/uOVBC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uOVBC.jpg" alt="enter image description here"></a>
  I've looked at <a href="http://forums.xamarin.com/discussion/21226/how-to-right-align-a-view-inside-a-list-item" rel="nofollow noreferrer">http://forums.xamarin.com/discussion/21226/how-to-right-align-a-view-inside-a-list-item</a> but this doesn't work for me.</p>
  
  <p>Any ideas?</p>