示例#1
0
文件: Util.cs 项目: Tryan18/XAMARIN
		//For DetectScreenSize method to work properly SetDisplayMetrics method must be first called
		public static CustomSize DetectScreenSize ()
		{
			if (cs == null) 
			{
				DisplayMetrics metrics = displayMetrics;
				int width = metrics.WidthPixels;//ConvertPixelsToDp(metrics.WidthPixels);
				int height = metrics.HeightPixels;//ConvertPixelsToDp(metrics.HeightPixels);
				//cs = new CustomSize(720,1280);
				cs = new CustomSize(width,height);
			}
			return cs;
			//return new int[] { width, height };
		}
示例#2
0
文件: Util.cs 项目: logoutzza/XAMARIN
 //For DetectScreenSize method to work properly SetDisplayMetrics method must be first called
 public static CustomSize DetectScreenSize()
 {
     if (cs == null)
     {
         DisplayMetrics metrics = displayMetrics;
         int            width   = metrics.WidthPixels;   //ConvertPixelsToDp(metrics.WidthPixels);
         int            height  = metrics.HeightPixels;  //ConvertPixelsToDp(metrics.HeightPixels);
         //cs = new CustomSize(720,1280);
         cs = new CustomSize(width, height);
     }
     return(cs);
     //return new int[] { width, height };
 }