Android UI 相关知识

android.content.res 资源类

  int getColor(int id) 对应res/values/colors.xml
  Drawable getDrawable(int id) 对应res/drawable/
  XmlResourceParser getLayout(int id) 对应res/layout/
  String getString(int id) 和CharSequence getText(int id) 对应res/values/strings.xml
  InputStream openRawResource(int id) 对应res/raw/
  void parseBundleExtra (String tagName, AttributeSet attrs, Bundle outBundle) 对应res/xml/
  String[] getStringArray(int id) res/values/arrays.xml
  float getDimension(int id) res/values/dimens.xml

  static int parseColor(String colorString) 解析一种颜色字符串的值,比如传入Color.BLACK
本类返回的均为一个整形类似 绿色为0xff00ff00,红色为0xffff0000。我们将这个DWORD型看做AARRGGBB,AA代表Aphla透明色,后面的就不难理解,每个分成WORD整好为0-255。



原文地址:https://www.cnblogs.com/leealvin/p/2361617.html