layout - Android studio开发app时, values-w820dp文件夹是什么意思?
巴扎黑
巴扎黑 2017-04-17 17:50:46
0
2
709

820dp是指屏幕分辨率还是尺寸大小什么的?比如Samsung G920V手机符合820dp吗?

巴扎黑
巴扎黑

reply all(2)
大家讲道理
  1. values-w820dp indicates that the minimum width of the screen required by the resources in this directory is 820dp.

  2. I searched the screen configuration parameters of Samsung G920V: 1440x2560 pixels, screen size 5.1 inches, dpi=576. Therefore, the minimum screen width of Samsung G920V is: 400dp (1440 * 160 / 576), so it does not meet the requirements of w820dp.

For more knowledge, you can refer to the official Android documentation: https://developer.android.com..., I am currently translating it, and a link will be given after the translation is completed.

It took a week and the translation was finally completed. Chinese link: http://blog.csdn.net/wzy_1988...

小葫芦

Devices with a screen width of 820dp and above call resource files in this directory. dp is a relative size, which can be obtained by screen width ÷ screen pixel density
Screen width
public static int getScreenWidth(Activity activity){

    DisplayMetrics metric = new DisplayMetrics();
    activity.getWindowManager().getDefaultDisplay().getMetrics(metric);
    int width=metric.widthPixels;
    return width;
}
屏幕像素密度
 public  static float getScreenDensity(Activity activity){
    DisplayMetrics metric = new DisplayMetrics();
    activity.getWindowManager().getDefaultDisplay().getMetrics(metric);
    float density = metric.density;
    return density;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template