/**
     * 把pix值转换为sp
     *
     * @return
     */
    public static float px2sp(Context context, float pixValue) {
        final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
        return  pixValue / fontScale + 0.5f;
    }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-12-22
  • 2022-12-23
  • 2021-10-12
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2021-06-07
  • 2021-07-13
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案