Based on my previous question about positioning a background image, I thought that a possible solution might be to set the width to the display size, and calculate the height of the image from that.
The problem is that I don't know how to get the actual display size. I thought I could just implement something like IDisplay
and use the DependencyService
, but I can't figure out how to implement the Android part, since all of the examples I've found expect to be in either a view or an activity, and use something like Context.Resources.DisplayMetrics
, which however isn't available in my POCO implementation of the service.
Is there any other way to access the display metrics globally, or am I just approaching this wrong?