Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting screen size android with xamarin

I was wondering if anyone knows a simple way to get the height and width of an android screen size using c# in Xamarin. I need to get the screen size so that I can use it in one of my adapter classes. I have tried using the display and the IWindowManager but without success. Any help or a point in the right direction would be much appreciated. Thanks in advance!!

like image 438
Aaron B Avatar asked Sep 22 '16 20:09

Aaron B


1 Answers

The answer that worked best for me was using

var metrics = Resources.DisplayMetrics;

Thank you all for your help!

like image 174
Aaron B Avatar answered Sep 30 '22 14:09

Aaron B