Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save youngcm2/7594284 to your computer and use it in GitHub Desktop.
Save youngcm2/7594284 to your computer and use it in GitHub Desktop.
using System;
using MonoTouch.UIKit;
using System.Drawing;
namespace Rendr.iOS.Util
{
public static class Environment
{
public static bool IsIOS7{
get{
var systemVersion = UIDevice.CurrentDevice.SystemVersion;
var versionnNumber = float.Parse (systemVersion.ToCharArray()[0].ToString());
return (versionnNumber >= 7);
}
}
public static PointF DeviceCenter
{
get{
return new PointF (ScreenWidth/2, DeviceScreenHeight/2);
}
}
public static float ScreenWidth = 320;
public static float DeviceScreenHeight{
get{
return (IsIOS7)?UIScreen.MainScreen.Bounds.Height:UIScreen.MainScreen.Bounds.Height - 20;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment