一、引言
很多时候,我们往往容易忘记最基础的知识,此篇文章当做最基础的知识笔记,不定时更新。
二、此篇主要包括Android对各类资源的引用
1、float android.content.res.Resources.getFraction(int id, int base, int pbase);--2017.7.12于GM
id | int : The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier. |
base | int : The base value of this fraction. In other words, a standard fraction is multiplied by this value. |
pbase | int : The parent base value of this fraction. In other words, a parent fraction (nn%p) is multiplied by this value. |
代码中引用:getResources().getFraction(R.fraction.battery_button_height_fraction, 1, 1);
资源文件位置 : values/dimens.xml
<fraction name="battery_button_height_fraction">10.5%</fraction>