Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Problem with image size

$
0
0

Hello :)

i'm trying to make 2 big image fit next to another in my screen but i can't seems to make it work :/

I tried with stacklayout and with grid 2x1 and had different problem

this is my images :

var left = new Image{
Source = ImageSource.FromFile("left"),
Aspect = Aspect.AspectFit,
};
var right = new Image{
Source = ImageSource.FromFile("right"),
Aspect = Aspect.AspectFit,
};

this is the stack :

var b> uttonStack = new StackLayout (){
Orientation = StackOrientation.Horizontal,
Spacing = 0,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = {
left,
right,
},
};

& this is the grid :

Grid grid = new Grid{
RowSpacing = 0,
ColumnSpacing = 0,
VerticalOptions = LayoutOptions.Start,
HorizontalOptions = LayoutOptions.FillAndExpand,
RowDefinitions = {
new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) },
new RowDefinition { Height = new GridLength(0, GridUnitType.Auto) },
}
};
grid.Children.Add (circadian,0,0);
grid.Children.Add (jetlag,1,0);

the problem with the stack is that the aspectFit doesn't seems to work my images are still way to big and get of the screen
the problem with the grid is that i have a big spacing on top & under the grid instead of just sitting under the differents views

Any idea how to make it work ?

Thanks a lot !


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>