Android 如何获取系统字体大小

2019-05-21 14:50:57


public static float getFontSize() {

        Configuration mCurConfig = new Configuration();

        try {

            mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration());

        } catch (RemoteException e) {

            Log.w(TAG, "Unable to retrieve font size");

        }

 

        Log.w(TAG, "getFontSize(), Font size is " + mCurConfig.fontScale);

        return mCurConfig.fontScale;

 

    }


  • 2021-05-25 13:10:49

    npm 多个不同版本的依赖

    提起 npm,大家第一个想到的应该就是 npm install 了,但是 npm install 之后生成的 node_modules 大家有观察过吗?package-lock.json 文件的作用大家知道吗?除了 dependencies 和 devDependencies,其他的依赖有什么作用呢?接下来,本文将针对 npm 中的你可能忽略的细节和大家分享一些经验 。