Forked from benbishop/Xamarin iOS Environment Util
Created
November 22, 2013 03:23
-
-
Save youngcm2/7594284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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