有些手机可以正确拿到分辨率,有些不行,我现在用androidCodeCompiler来获取,代码是
AndroidCodeProvider provider = new AndroidCodeProvider();
provider.Imports.Add("android.graphics.Point");
provider.MethodBody = @"
Point point=new Point();
activity.getWindowManager().getDefaultDisplay().getRealSize(point);
resultValue=point.toString();"; |