Android之基础知识(一)

一、引言

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

二、此篇主要包括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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值