Android之基础知识(一)

来源:互联网 发布:巴比伦空中花园知乎 编辑:程序博客网 时间:2024/06/05 09:22

一、引言

    很多时候,我们往往容易忘记最基础的知识,此篇文章当做最基础的知识笔记,不定时更新。

二、此篇主要包括Android对各类资源的引用

1、float android.content.res.Resources.getFraction(int id, int base, int pbase);--2017.7.12于GM

    idint: 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.baseint: The base value of this fraction. In other words, a standard fraction is multiplied by this value.pbaseint: 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>

原创粉丝点击