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

How to set row height of a list view cell based on the screen width

$
0
0

I have an app where i'm trying to display images in a list view. It's one image per row but i want the image to goacross the whole width of the screen so I need it to get larger / smaller depending on the screen width. that's fine - i have that working but I therefore also need the height of the cell to adjust so that the aspect ratio of the image stays the same. That's also fine within the cell however i need the listView RowHeight to adjust based on that. Is there a simple way of telling the RowHeight to just expand based on the height of the cell or do i need to get the screen width and calculate it? the aspect ratio will always be the same so each image will be the same height.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



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