[Xamarin]Get the Screen Height and convert for Height Request
That is impossible to detect screen size in the Xamarin Form. You have to do in the native Android code.l suggest to do in MainActivity and then put in the static variable in the Forms PCL project like this:
Android.Util.DisplayMetrics displayMetrics = new Android.Util.DisplayMetrics();
Also, the unit of HeightRequest is device-independent units. But I found if you use HeightPixel divide by Density of the screen, then it will convert into the unit for HeightRequest or WidthRequest
Trackback address for this post
Feedback awaiting moderation
This post has 3897 feedbacks awaiting moderation...
Form is loading...