Android之基礎知識(一)

2021-08-03 17:58:55 字數 824 閱讀 3166

一、引言

很多時候,我們往往容易忘記最基礎的知識,此篇文章當做最基礎的知識筆記,不定時更新。

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

10.5%

android基礎知識

1.android paint和color類 要繪圖,首先得調整畫筆,待畫筆調整好之後,再將影象繪製到畫布上,這樣才可以顯示在手機螢幕上。android 中的畫筆是 paint類,paint 中包含了很多方法對其屬性進行設定,主要方法如下 setantialias 設定畫筆的鋸齒效果。setcolo...

Android 基礎知識

我們是 h是對應 2560 1440 xxh是對應 1920 1080 1dp 3px xh是對應 1280 720 1dp 2px h是對應 800 480 m是對應 480 320 bg splash.png error failed to read png signature file doe...

Android基礎知識

android 教程 菜鳥教程 android 知識體系文件新增鏈結描述 android 頁面布局 共六種 線性布局linearlayout 布局tablelayout 相對布局relativelayout 層布局framelayout 絕對布局absolutelayout 網格布局gridlayo...