Determine Screen Size in Sketchware
The code is:
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics ();
display.getMetrics(outMetrics);
float density = getResources().getDisplayMetrics().density;
float height = outMetrics.heightPixels / density;
float width = outMetrics.widthPixels / density;
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics ();
display.getMetrics(outMetrics);
float density = getResources().getDisplayMetrics().density;
float height = outMetrics.heightPixels / density;
float width = outMetrics.widthPixels / density;
Comments
Post a Comment