Xamarin - AspectFill but anchor to the top

SSB 86 Reputation points
2022-10-07T14:40:55.407+00:00

Hi,

I have an image - it needs to have a fixed height and the width to be full width of the container. Currently i have the following code which is working OK, however, the image seems to be anchored in the center. I need to anchor it to the top. So it should just chop the bottom off instead of the top and the bottom.

Right now it is doing this:
248537-image.png

What I need it to do is align to the top:
248557-image.png

Any thoughts on how I can get this to show like that?

My current code is

<yummy:PancakeView CornerRadius="20" Margin="10,0" >  
        

                    <Grid BackgroundColor="White" >  


                       <ffimageloading:CachedImage Source="{Binding PictureSource, Mode=TwoWay }"  
                                    HorizontalOptions="FillAndExpand"  
                                    VerticalOptions="StartAndExpand"  
                                    Aspect="AspectFill"  
                                    HeightRequest="525"                  
                                    Margin="0,0,0,0"  
                                    >  
                        </ffimageloading:CachedImage>  

                    </Grid>  

</yummy:PancakeView>  
        
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,299 questions
{count} votes