Resource Types

Each of the documents in this section describe the usage, format and syntax for a certain type of application resource that you can provide in your resources directory (res/).

Here's a brief summary of each resource type:

Animation Resources
Define pre-determined animations.
Tween animations are saved in  res/anim/ and accessed from the  R.anim class.
Frame animations are saved in  res/drawable/ and accessed from the  R.drawable class.
Color State List Resource
Define a color resources that changes based on the View state.
Saved in  res/color/ and accessed from the  R.color class.
Drawable Resources
Define various graphics with bitmaps or XML.
Saved in  res/drawable/ and accessed from the  R.drawable class.
Layout Resource
Define the layout for your application UI.
Saved in  res/layout/ and accessed from the  R.layout class.
Menu Resource
Define the contents of your application menus.
Saved in  res/menu/ and accessed from the  R.menu class.
String Resources
Define strings, string arrays, and plurals (and include string formatting and styling).
Saved in  res/values/ and accessed from the  R.stringR.array, and  R.plurals classes.
Style Resource
Define the look and format for UI elements.
Saved in  res/values/ and accessed from the  R.style class.
More Resource Types
Define values such as booleans, integers, dimensions, colors, and other arrays.

Saved in res/values/ but each accessed from unique R sub-classes (such as R.boolR.integer,R.dimen, etc.).

每一本节中的文件描述了某些类型的应用程序资源,你可以在你的资源目录(提供使用,格式和语法RES /)。

这里的每个资源类型的简短摘要:

动画资源
定义预先确定的动画。
吐温的动画保存在 RES /动画/从访问 R.anim类。
帧动画保存在 RES /绘制/从访问 R.drawable类。
颜色状态列表资源
定义变化基于视图状态下显色的资源。
保存在 RES /彩色/从访问 R.color类。
绘图资源
定义各种图形与位图或XML。
在保存 RES /绘制/从访问 R.drawable类。
资源布局
为应用程序定义的UI布局。
保存在 RES /布局/从访问 R.layout类。
菜单资源
定义你的应用程序菜单中的内容。
保存在 RES /菜单/,并从访问 R.menu类。
字符串资源
定义字符串,字符串数组和复数形式(并包含字符串格式化和样式)。
在保存 RES /价值/从访问 R.stringR.arrayR.plurals类。
样式资源
定义UI元素的外观和格式
保存在 RES /价值/从访问 R.style类。
更多资源类型
定义值,如布尔,整数,尺寸,颜色和其他数组。
在保存 RES /价值/但每个从独特的访问 - [R子类(如 R.boolR.integerR.dimen等)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值