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;

 

    }


  • 2019-09-29 10:28:04

    程序员实用工具网站

    程序员开发需要具备良好的信息检索能力,为了备忘(收藏夹真是满了),将开发过程中常用的网站进行整理。