abdul
abdul

Reputation: 325

Align button to the right side in xamarin forms

I have below xaml code and all I need is to aligh the button showin in the image attached to be in the right side . Please see complete code below :

 <AbsoluteLayout Padding="0">

     <maps:Map AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" x:Name="map"
               MyLocationEnabled="True" IsTrafficEnabled="True" MapType="Street" IsShowingUser="True"
                  HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />

           <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >

                   <pcv:PancakeView  
                        Margin="0,30,10,-30" 
                        BackgroundColor="White" 
                        CornerRadius="30" 
                        HasShadow="True" 
                        HeightRequest="60" 
                        HorizontalOptions="EndAndExpand" 
                        VerticalOptions="End" 
                        WidthRequest="60">

                    <Image >
                        <Image.Source>
                            <FontImageSource
                                  Glyph="{x:Static local:IoniconsFont.IosCloseOutline }"
                                   Size="30"
                                   Color="Gray"
                                   FontFamily="{StaticResource IonIcons}" />
                        </Image.Source>
                        <Image.GestureRecognizers>
                          <TapGestureRecognizer Tapped="OnBackClicked" />
                        </Image.GestureRecognizers>
                    </Image>

            </pcv:PancakeView>

         </StackLayout>

</AbsoluteLayout>

enter image description here

Upvotes: 1

Views: 1357

Answers (1)

Jasmin Sojitra
Jasmin Sojitra

Reputation: 1301

XAML Tips:

FillAndExpand XY:

AbsoluteLayout.LayoutBounds="0, 0, 1, 1" 
AbsoluteLayout.LayoutFlags="All"

Center XY:

AbsoluteLayout.LayoutBounds="0.5, 0.5, -1, -1"     
AbsoluteLayout.LayoutFlags="PositionProportional"

Vertical Center, Horizontal Fill:

AbsoluteLayout.LayoutBounds="0.5, 0.5, 1, -1" 
AbsoluteLayout.LayoutFlags="PositionProportional"

Vertical End, Horizontal Center

AbsoluteLayout.LayoutBounds="0.5, 1, -1, -1" 
AbsoluteLayout.LayoutFlags="PositionProportional"

Vertical Start, Horizontal Center

AbsoluteLayout.LayoutBounds="0.5, 0, -1, -1" 
AbsoluteLayout.LayoutFlags="PositionProportional"

Vertical Start, Horizontal Start

AbsoluteLayout.LayoutBounds="0, 0, -1, -1" 
AbsoluteLayout.LayoutFlags="PositionProportional"

Upvotes: 1

Related Questions