public static GetActualHeight ( this device ) : float | ||
device | this | |
return | float |
public static float GetActualHeight(this UIDevice device)
{
var orientation = device.Orientation;
var landscape = orientation == UIDeviceOrientation.LandscapeLeft || orientation == UIDeviceOrientation.LandscapeRight;
if (landscape)
{
return UIScreen.MainScreen.Bounds.Width;
}
else
{
return UIScreen.MainScreen.Bounds.Height;
}
}
}