I have this image:
var logoImage = new Image ()
{
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Aspect = Aspect.AspectFit
};
But it is not stretched vertically. Result here:
If I remove the HorizontalOptions all will work out well. However, the image will be centered , but i need the left side.
P.S. The image is in Grid.
public class TopMenu:Grid
{
public TopMenu ()
{
this.HeightRequest = 40;
this.Padding = 0;
this.BackgroundColor = Color.FromRgb (255, 146, 0);
var logoImage = new Image () { Source = ImageSource.FromResource ("***.Images.TopMenu.logo_new.gif"),
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Aspect = Aspect.AspectFit };
this.Children.Add (logoImage);
}
}